public void UpdateSubReportScopes(UserSortFilterContext context)
 {
     if (this.m_containingScopes != null && 0 < this.m_containingScopes.Count && this.m_containingScopes.LastEntry == null)
     {
         if (context.DetailScopeSubReports != null)
         {
             this.m_detailScopeSubReports = context.DetailScopeSubReports.Clone();
         }
         else
         {
             this.m_detailScopeSubReports = new SubReportList();
         }
         this.m_detailScopeSubReports.Add(this);
     }
     else
     {
         this.m_detailScopeSubReports = context.DetailScopeSubReports;
     }
     if (context.ContainingScopes != null)
     {
         if (this.m_containingScopes != null && 0 < this.m_containingScopes.Count)
         {
             this.m_containingScopes.InsertRange(0, context.ContainingScopes);
         }
         else
         {
             this.m_containingScopes = context.ContainingScopes;
         }
     }
 }
 public void PrepareForSorting(ReportProcessing.ProcessingContext processingContext)
 {
     Global.Tracer.Assert(!this.m_processed, "(!m_processed)");
     if (this.m_eventTarget != null && this.m_sortFilterExpressionScopeObjects != null)
     {
         processingContext.UserSortFilterContext.CurrentSortFilterEventSource = this.m_eventSource;
         for (int i = 0; i < this.m_sortFilterExpressionScopeObjects.Count; i++)
         {
             SortFilterExpressionScopeObj sortFilterExpressionScopeObj = (SortFilterExpressionScopeObj)this.m_sortFilterExpressionScopeObjects[i];
             sortFilterExpressionScopeObj.SortSEScopes(processingContext, this.m_eventSource);
         }
         GroupingList groupsInSortTarget = this.m_eventSource.UserSort.GroupsInSortTarget;
         if (groupsInSortTarget != null && 0 < groupsInSortTarget.Count)
         {
             this.m_groupExpressionsInSortTarget = new ReportProcessing.RuntimeExpressionInfoList();
             for (int j = 0; j < groupsInSortTarget.Count; j++)
             {
                 Grouping grouping = groupsInSortTarget[j];
                 for (int k = 0; k < grouping.GroupExpressions.Count; k++)
                 {
                     this.m_groupExpressionsInSortTarget.Add(new ReportProcessing.RuntimeExpressionInfo(grouping.GroupExpressions, grouping.ExprHost, null, k));
                 }
             }
         }
         this.CollectSortOrders();
     }
 }
示例#3
0
 public void Add(GroupingList scopeDefs, VariantList[] scopeValues, int value)
 {
     if (scopeValues == null || scopeValues.Length == 0)
     {
         Global.Tracer.Assert(scopeDefs == null || 0 == scopeDefs.Count, "(null == scopeDefs || 0 == scopeDefs.Count)");
         this.m_lookupTable = value;
     }
     else
     {
         bool flag = true;
         if (this.m_lookupTable == null)
         {
             this.m_lookupTable = new Hashtable();
             flag = false;
         }
         Hashtable hashtable = (Hashtable)this.m_lookupTable;
         int       num       = 0;
         int       num2      = 0;
         for (int i = 0; i < scopeValues.Length; i++)
         {
             VariantList variantList = scopeValues[i];
             if (variantList == null)
             {
                 num2++;
             }
             else
             {
                 num = variantList.Count;
                 if (i == scopeValues.Length - 1)
                 {
                     num--;
                 }
                 this.GetNullScopeEntries(num2, ref hashtable, ref flag);
                 for (int j = 0; j < num; j++)
                 {
                     Hashtable hashtable2 = (!flag) ? null : ((Hashtable)hashtable[((ArrayList)variantList)[j]]);
                     if (hashtable2 == null)
                     {
                         hashtable2 = new Hashtable();
                         hashtable.Add(((ArrayList)variantList)[j], hashtable2);
                         flag = false;
                     }
                     hashtable = hashtable2;
                 }
                 num2 = 0;
             }
         }
         object key = 1;
         if (scopeValues[scopeValues.Length - 1] != null)
         {
             key = ((ArrayList)scopeValues[scopeValues.Length - 1])[num];
         }
         else
         {
             this.GetNullScopeEntries(num2, ref hashtable, ref flag);
         }
         Global.Tracer.Assert(!hashtable.Contains(key), "(!hashEntries.Contains(lastKey))");
         hashtable.Add(key, value);
     }
 }
示例#4
0
 public UserSortFilterContext(UserSortFilterContext parentContext, SubReport subReport)
 {
     this.m_runtimeSortFilterInfo  = parentContext.RuntimeSortFilterInfo;
     this.m_dataSetID              = parentContext.DataSetID;
     this.m_containingScopes       = subReport.ContainingScopes;
     this.m_detailScopeSubReports  = subReport.DetailScopeSubReports;
     this.m_inProcessUserSortPhase = parentContext.m_inProcessUserSortPhase;
 }
示例#5
0
 public UserSortFilterContext(UserSortFilterContext copy)
 {
     this.m_runtimeSortFilterInfo  = copy.RuntimeSortFilterInfo;
     this.m_currentContainingScope = copy.CurrentContainingScope;
     this.m_containingScopes       = copy.ContainingScopes;
     this.m_dataSetID              = copy.DataSetID;
     this.m_detailScopeSubReports  = copy.DetailScopeSubReports;
     this.m_inProcessUserSortPhase = copy.m_inProcessUserSortPhase;
 }
        public new GroupingList Clone()
        {
            int          count        = this.Count;
            GroupingList groupingList = new GroupingList(count);

            for (int i = 0; i < count; i++)
            {
                groupingList.Add(this[i]);
            }
            return(groupingList);
        }
示例#7
0
        public int Lookup(GroupingList scopeDefs, VariantList[] scopeValues)
        {
            object obj = null;

            if (scopeValues == null || scopeValues.Length == 0)
            {
                Global.Tracer.Assert(scopeDefs == null || 0 == scopeDefs.Count, "(null == scopeDefs || 0 == scopeDefs.Count)");
                obj = this.m_lookupTable;
            }
            else
            {
                Hashtable hashtable = (Hashtable)this.m_lookupTable;
                int       num       = 0;
                for (int i = 0; i < scopeValues.Length; i++)
                {
                    VariantList variantList = scopeValues[i];
                    if (variantList == null)
                    {
                        num++;
                    }
                    else
                    {
                        hashtable = (Hashtable)hashtable[num];
                        for (int j = 0; j < variantList.Count; j++)
                        {
                            obj = hashtable[((ArrayList)variantList)[j]];
                            if (i < scopeValues.Length - 1 || j < variantList.Count - 1)
                            {
                                hashtable = (Hashtable)obj;
                                Global.Tracer.Assert(null != hashtable, "(null != hashEntries)");
                            }
                        }
                        num = 0;
                    }
                }
                if (scopeValues[scopeValues.Length - 1] == null)
                {
                    hashtable = (Hashtable)hashtable[num];
                    obj       = hashtable[1];
                }
            }
            Global.Tracer.Assert(obj is int);
            return((int)obj);
        }
示例#8
0
        private GroupingList GenerateUserSortGroupingList(bool rowIsInnerGrouping)
        {
            GroupingList groupingList = new GroupingList();

            for (MatrixHeading matrixHeading = rowIsInnerGrouping ? this.m_rows : this.m_columns; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                if (matrixHeading.Grouping != null)
                {
                    groupingList.Add(matrixHeading.Grouping);
                }
            }
            for (MatrixHeading matrixHeading = rowIsInnerGrouping ? this.m_columns : this.m_rows; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                if (matrixHeading.Grouping != null)
                {
                    groupingList.Add(matrixHeading.Grouping);
                }
            }
            return(groupingList);
        }
        public object GetSortOrder(ReportRuntime runtime)
        {
            object obj = null;

            if (this.m_eventSource.UserSort.SortExpressionScope == null)
            {
                obj = runtime.EvaluateUserSortExpression(this.m_eventSource);
            }
            else if (this.m_sortOrders == null)
            {
                obj = null;
            }
            else
            {
                GroupingList groupsInSortTarget = this.m_eventSource.UserSort.GroupsInSortTarget;
                if (groupsInSortTarget == null || groupsInSortTarget.Count == 0)
                {
                    obj = this.m_sortOrders.LookupTable;
                }
                else
                {
                    bool      flag      = true;
                    bool      flag2     = false;
                    int       num       = 0;
                    Hashtable hashtable = (Hashtable)this.m_sortOrders.LookupTable;
                    int       num2      = 0;
                    int       num3      = 0;
                    while (num3 < groupsInSortTarget.Count)
                    {
                        IEnumerator enumerator = hashtable.Keys.GetEnumerator();
                        enumerator.MoveNext();
                        num2 = (int)enumerator.Current;
                        for (int i = 0; i < num2; i++)
                        {
                            num += groupsInSortTarget[num3++].GroupExpressions.Count;
                        }
                        hashtable = (Hashtable)hashtable[num2];
                        if (num3 < groupsInSortTarget.Count)
                        {
                            Grouping grouping = groupsInSortTarget[num3];
                            for (int j = 0; j < grouping.GroupExpressions.Count; j++)
                            {
                                object key = runtime.EvaluateRuntimeExpression(this.m_groupExpressionsInSortTarget[num], ObjectType.Grouping, grouping.Name, "GroupExpression");
                                num++;
                                obj = hashtable[key];
                                if (obj == null)
                                {
                                    flag = false;
                                    break;
                                }
                                if (num < this.m_groupExpressionsInSortTarget.Count)
                                {
                                    hashtable = (Hashtable)obj;
                                }
                            }
                            num3++;
                            if (!flag)
                            {
                                break;
                            }
                            continue;
                        }
                        flag2 = true;
                        break;
                    }
                    if (flag && flag2)
                    {
                        obj = hashtable[1];
                        if (obj == null)
                        {
                            flag = false;
                        }
                    }
                    if (flag)
                    {
                        this.m_currentInstanceIndex = this.m_currentSortIndex + 1;
                    }
                    else
                    {
                        obj = this.m_currentInstanceIndex;
                    }
                }
            }
            if (obj == null)
            {
                obj = DBNull.Value;
            }
            return(obj);
        }
示例#10
0
 public bool PopulateRuntimeSortFilterEventInfo(ReportProcessing.ProcessingContext pc, DataSet myDataSet)
 {
     if (pc.UserSortFilterInfo != null && pc.UserSortFilterInfo.SortInfo != null && pc.OldSortFilterEventInfo != null)
     {
         if (this.m_dataSetID != -1)
         {
             return(false);
         }
         this.m_runtimeSortFilterInfo = null;
         EventInformation.SortEventInfo sortInfo = pc.UserSortFilterInfo.SortInfo;
         for (int i = 0; i < sortInfo.Count; i++)
         {
             int uniqueNameAt = sortInfo.GetUniqueNameAt(i);
             SortFilterEventInfo sortFilterEventInfo = pc.OldSortFilterEventInfo[uniqueNameAt];
             if (sortFilterEventInfo != null && sortFilterEventInfo.EventSource.UserSort != null && sortFilterEventInfo.EventSource.UserSort.DataSetID == myDataSet.ID)
             {
                 if (this.m_runtimeSortFilterInfo == null)
                 {
                     this.m_runtimeSortFilterInfo = new RuntimeSortFilterEventInfoList();
                 }
                 this.m_runtimeSortFilterInfo.Add(new RuntimeSortFilterEventInfo(sortFilterEventInfo.EventSource, uniqueNameAt, sortInfo.GetSortDirectionAt(i), sortFilterEventInfo.EventSourceScopeInfo));
             }
         }
         if (this.m_runtimeSortFilterInfo != null)
         {
             int count = this.m_runtimeSortFilterInfo.Count;
             for (int j = 0; j < count; j++)
             {
                 TextBox          eventSource         = this.m_runtimeSortFilterInfo[j].EventSource;
                 ISortFilterScope sortExpressionScope = eventSource.UserSort.SortExpressionScope;
                 if (sortExpressionScope != null)
                 {
                     sortExpressionScope.IsSortFilterExpressionScope = this.SetSortFilterInfo(sortExpressionScope.IsSortFilterExpressionScope, count, j);
                 }
                 ISortFilterScope sortTarget = eventSource.UserSort.SortTarget;
                 if (sortTarget != null)
                 {
                     sortTarget.IsSortFilterTarget = this.SetSortFilterInfo(sortTarget.IsSortFilterTarget, count, j);
                 }
                 if (eventSource.ContainingScopes != null && 0 < eventSource.ContainingScopes.Count)
                 {
                     int num = 0;
                     for (int k = 0; k < eventSource.ContainingScopes.Count; k++)
                     {
                         Grouping    grouping    = eventSource.ContainingScopes[k];
                         VariantList variantList = this.m_runtimeSortFilterInfo[j].SortSourceScopeInfo[k];
                         if (grouping != null)
                         {
                             if (grouping.SortFilterScopeInfo == null)
                             {
                                 grouping.SortFilterScopeInfo = new VariantList[count];
                                 for (int l = 0; l < count; l++)
                                 {
                                     grouping.SortFilterScopeInfo[l] = null;
                                 }
                                 grouping.SortFilterScopeIndex = new int[count];
                                 for (int m = 0; m < count; m++)
                                 {
                                     grouping.SortFilterScopeIndex[m] = -1;
                                 }
                             }
                             grouping.SortFilterScopeInfo[j]  = variantList;
                             grouping.SortFilterScopeIndex[j] = k;
                         }
                         else
                         {
                             SubReportList detailScopeSubReports = eventSource.UserSort.DetailScopeSubReports;
                             ReportItem    parent;
                             if (detailScopeSubReports != null && num < detailScopeSubReports.Count)
                             {
                                 parent = detailScopeSubReports[num++].Parent;
                             }
                             else
                             {
                                 Global.Tracer.Assert(k == eventSource.ContainingScopes.Count - 1, "(j == eventSource.ContainingScopes.Count - 1)");
                                 parent = eventSource.Parent;
                             }
                             while (parent != null && !(parent is DataRegion))
                             {
                                 parent = parent.Parent;
                             }
                             Global.Tracer.Assert(parent is DataRegion, "(parent is DataRegion)");
                             DataRegion dataRegion = (DataRegion)parent;
                             if (dataRegion.SortFilterSourceDetailScopeInfo == null)
                             {
                                 dataRegion.SortFilterSourceDetailScopeInfo = new int[count];
                                 for (int n = 0; n < count; n++)
                                 {
                                     dataRegion.SortFilterSourceDetailScopeInfo[n] = -1;
                                 }
                             }
                             Global.Tracer.Assert(variantList != null && 1 == variantList.Count, "(null != scopeValues && 1 == scopeValues.Count)");
                             dataRegion.SortFilterSourceDetailScopeInfo[j] = (int)((ArrayList)variantList)[0];
                         }
                     }
                 }
                 GroupingList groupsInSortTarget = eventSource.UserSort.GroupsInSortTarget;
                 if (groupsInSortTarget != null)
                 {
                     for (int num3 = 0; num3 < groupsInSortTarget.Count; num3++)
                     {
                         groupsInSortTarget[num3].NeedScopeInfoForSortFilterExpression = this.SetSortFilterInfo(groupsInSortTarget[num3].NeedScopeInfoForSortFilterExpression, count, j);
                     }
                 }
                 IntList peerSortFilters = eventSource.GetPeerSortFilters(false);
                 if (peerSortFilters != null)
                 {
                     if (this.m_runtimeSortFilterInfo[j].PeerSortFilters == null)
                     {
                         this.m_runtimeSortFilterInfo[j].PeerSortFilters = new Hashtable();
                     }
                     for (int num4 = 0; num4 < peerSortFilters.Count; num4++)
                     {
                         if (eventSource.ID != peerSortFilters[num4])
                         {
                             this.m_runtimeSortFilterInfo[j].PeerSortFilters.Add(peerSortFilters[num4], null);
                         }
                     }
                 }
             }
         }
         return(true);
     }
     return(false);
 }