void IHierarchyObj.Traverse(ProcessingStages operation, ITraversalContext traversalContext)
 {
     if (this.m_sortHierarchyStruct != null)
     {
         bool ascending = true;
         RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = this.m_sortHierarchyStruct.SortInfo.Value();
         if (runtimeSortFilterEventInfo.EventSource.UserSort.SortExpressionScope == null)
         {
             ascending = runtimeSortFilterEventInfo.SortDirection;
         }
         this.m_sortHierarchyStruct.SortTree.Traverse(operation, ascending, traversalContext);
     }
     if (this.m_dataHolder != null)
     {
         using (this.m_dataHolder.PinValue())
         {
             this.m_dataHolder.Value().Traverse(operation, traversalContext);
         }
     }
     if (this.m_dataRowHolder != null)
     {
         using (this.m_hierarchyRoot.PinValue())
         {
             this.m_dataRowHolder.Traverse(operation, traversalContext, this.m_hierarchyRoot.Value());
         }
     }
 }
Beispiel #2
0
        public void RegisterSortFilterExpressionScope(IReference <IScope> containerRef, IReference <RuntimeDataRegionObj> scopeRef, bool[] isSortFilterExpressionScope)
        {
            List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = this.m_runtimeSortFilterInfo;

            if (runtimeSortFilterInfo != null && isSortFilterExpressionScope != null && scopeRef != null)
            {
                List <object>[] array = null;
                using (scopeRef.PinValue())
                {
                    RuntimeDataRegionObj runtimeDataRegionObj = scopeRef.Value();
                    using (containerRef.PinValue())
                    {
                        IScope scope = containerRef.Value();
                        for (int i = 0; i < runtimeSortFilterInfo.Count; i++)
                        {
                            if (isSortFilterExpressionScope[i] && runtimeDataRegionObj.IsTargetForSort(i, false) && runtimeDataRegionObj.TargetScopeMatched(i, false))
                            {
                                IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[i];
                                using (reference.PinValue())
                                {
                                    RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                                    if (array == null && runtimeSortFilterEventInfo.EventSource.UserSort.GroupsInSortTarget != null)
                                    {
                                        int num = 0;
                                        array = new List <object> [runtimeSortFilterEventInfo.EventSource.UserSort.GroupsInSortTarget.Count];
                                        runtimeDataRegionObj.GetScopeValues(runtimeSortFilterEventInfo.EventTarget, array, ref num);
                                    }
                                    runtimeSortFilterEventInfo.RegisterSortFilterExpressionScope(ref scope.SortFilterExpressionScopeInfoIndices[i], scopeRef, array, i);
                                }
                            }
                        }
                    }
                }
            }
        }
        internal bool IsSortFilterTarget(bool[] isSortFilterTarget, IReference <IScope> outerScope, IReference <IHierarchyObj> target, ref RuntimeUserSortTargetInfo userSortTargetInfo)
        {
            bool result = false;

            if (m_runtimeSortFilterInfo != null && isSortFilterTarget != null && (outerScope == null || !outerScope.Value().TargetForNonDetailSort))
            {
                for (int i = 0; i < m_runtimeSortFilterInfo.Count; i++)
                {
                    IReference <RuntimeSortFilterEventInfo> reference = m_runtimeSortFilterInfo[i];
                    using (reference.PinValue())
                    {
                        RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                        if (isSortFilterTarget[i] && (outerScope == null || outerScope.Value().TargetScopeMatched(i, detailSort: false)))
                        {
                            runtimeSortFilterEventInfo.EventTarget = target;
                            runtimeSortFilterEventInfo.Processed   = false;
                            if (userSortTargetInfo == null)
                            {
                                userSortTargetInfo = new RuntimeUserSortTargetInfo(target, i, reference);
                            }
                            else
                            {
                                userSortTargetInfo.AddSortInfo(target, i, reference);
                            }
                            result = true;
                        }
                    }
                }
            }
            return(result);
        }
Beispiel #4
0
 public void AddSortInfoIndex(int sortInfoIndex, IReference <RuntimeSortFilterEventInfo> sortInfoRef)
 {
     using (sortInfoRef.PinValue())
     {
         RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = sortInfoRef.Value();
         Global.Tracer.Assert(runtimeSortFilterEventInfo.EventSource.UserSort.SortExpressionScope == null || !runtimeSortFilterEventInfo.TargetSortFilterInfoAdded);
         if (this.m_sortFilterInfoIndices == null)
         {
             this.m_sortFilterInfoIndices = new List <int>();
         }
         this.m_sortFilterInfoIndices.Add(sortInfoIndex);
         runtimeSortFilterEventInfo.TargetSortFilterInfoAdded = true;
     }
 }
Beispiel #5
0
 public void ProcessUserSortForTarget(ObjectModelImpl reportObjectModel, AspNetCore.ReportingServices.RdlExpressions.ReportRuntime reportRuntime, IReference <IHierarchyObj> target, ref ScalableList <DataFieldRow> dataRows, bool targetForNonDetailSort)
 {
     using (target.PinValue())
     {
         IHierarchyObj hierarchyObj = target.Value();
         if (targetForNonDetailSort && dataRows != null && 0 < dataRows.Count)
         {
             IReference <RuntimeSortFilterEventInfo> reference = null;
             try
             {
                 List <int> sortFilterInfoIndices = hierarchyObj.SortFilterInfoIndices;
                 Global.Tracer.Assert(null != hierarchyObj.SortTree, "(null != targetObj.SortTree)");
                 if (sortFilterInfoIndices != null)
                 {
                     reference = this.m_runtimeSortFilterInfo[sortFilterInfoIndices[0]];
                 }
                 RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = null;
                 if (reference != null)
                 {
                     reference.PinValue();
                     runtimeSortFilterEventInfo = reference.Value();
                 }
                 for (int i = 0; i < dataRows.Count; i++)
                 {
                     dataRows[i].SetFields(reportObjectModel.FieldsImpl);
                     object keyValue = DBNull.Value;
                     if (runtimeSortFilterEventInfo != null)
                     {
                         keyValue = runtimeSortFilterEventInfo.GetSortOrder(reportRuntime);
                     }
                     hierarchyObj.SortTree.NextRow(keyValue, hierarchyObj);
                 }
             }
             finally
             {
                 if (reference != null)
                 {
                     reference.UnPinValue();
                 }
             }
             if (dataRows != null)
             {
                 dataRows.Dispose();
             }
             dataRows = null;
         }
         hierarchyObj.MarkSortInfoProcessed(this.m_runtimeSortFilterInfo);
     }
 }
Beispiel #6
0
 private void MarkSortInfoProcessed(List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo, IReference <IHierarchyObj> sortTarget, ICollection indices)
 {
     foreach (int index in indices)
     {
         IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[index];
         using (reference.PinValue())
         {
             RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
             if (runtimeSortFilterEventInfo.EventTarget.Equals(sortTarget))
             {
                 Global.Tracer.Assert(!runtimeSortFilterEventInfo.Processed, "(!runtimeSortInfo.Processed)");
                 runtimeSortFilterEventInfo.Processed = true;
             }
         }
     }
 }
 protected void DetailHandleSortFilterEvent(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, IReference <IScope> outerScope, bool isColumnAxis, int rowIndex)
 {
     using (outerScope.PinValue())
     {
         IScope scope = outerScope.Value();
         List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = m_odpContext.RuntimeSortFilterInfo;
         if (runtimeSortFilterInfo == null || dataRegionDef.SortFilterSourceDetailScopeInfo == null || scope.TargetForNonDetailSort)
         {
             return;
         }
         int count = runtimeSortFilterInfo.Count;
         for (int i = 0; i < count; i++)
         {
             IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[i];
             using (reference.PinValue())
             {
                 RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                 if (runtimeSortFilterEventInfo.EventSource.ContainingScopes == null || 0 >= runtimeSortFilterEventInfo.EventSource.ContainingScopes.Count || -1 == dataRegionDef.SortFilterSourceDetailScopeInfo[i] || !scope.TargetScopeMatched(i, detailSort: false) || m_odpContext.ReportObjectModel.FieldsImpl.GetRowIndex() != dataRegionDef.SortFilterSourceDetailScopeInfo[i])
                 {
                     continue;
                 }
                 if (runtimeSortFilterEventInfo.EventSource.ContainingScopes.LastEntry == null)
                 {
                     Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem parent = runtimeSortFilterEventInfo.EventSource.Parent;
                     if (runtimeSortFilterEventInfo.EventSource.IsSubReportTopLevelScope)
                     {
                         while (parent != null && !(parent is Microsoft.ReportingServices.ReportIntermediateFormat.SubReport))
                         {
                             parent = parent.Parent;
                         }
                         Global.Tracer.Assert(parent is Microsoft.ReportingServices.ReportIntermediateFormat.SubReport, "(parent is SubReport)");
                         parent = parent.Parent;
                     }
                     if (parent == dataRegionDef)
                     {
                         runtimeSortFilterEventInfo.SetEventSourceScope(isColumnAxis, SelfReference, rowIndex);
                     }
                 }
                 runtimeSortFilterEventInfo.AddDetailScopeInfo(isColumnAxis, SelfReference, rowIndex);
             }
         }
     }
 }
 protected void DetailHandleSortFilterEvent(AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, IReference <IScope> outerScope, bool isColumnAxis, int rowIndex)
 {
     using (outerScope.PinValue())
     {
         IScope scope = outerScope.Value();
         List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = this.m_odpContext.RuntimeSortFilterInfo;
         if (runtimeSortFilterInfo != null && dataRegionDef.SortFilterSourceDetailScopeInfo != null && !scope.TargetForNonDetailSort)
         {
             int count = runtimeSortFilterInfo.Count;
             for (int i = 0; i < count; i++)
             {
                 IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[i];
                 using (reference.PinValue())
                 {
                     RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                     if (runtimeSortFilterEventInfo.EventSource.ContainingScopes != null && 0 < runtimeSortFilterEventInfo.EventSource.ContainingScopes.Count && -1 != dataRegionDef.SortFilterSourceDetailScopeInfo[i] && scope.TargetScopeMatched(i, false) && this.m_odpContext.ReportObjectModel.FieldsImpl.GetRowIndex() == dataRegionDef.SortFilterSourceDetailScopeInfo[i])
                     {
                         if (runtimeSortFilterEventInfo.EventSource.ContainingScopes.LastEntry == null)
                         {
                             AspNetCore.ReportingServices.ReportIntermediateFormat.ReportItem parent = runtimeSortFilterEventInfo.EventSource.Parent;
                             if (runtimeSortFilterEventInfo.EventSource.IsSubReportTopLevelScope)
                             {
                                 while (parent != null && !(parent is AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport))
                                 {
                                     parent = parent.Parent;
                                 }
                                 Global.Tracer.Assert(parent is AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport, "(parent is SubReport)");
                                 parent = parent.Parent;
                             }
                             if (parent == dataRegionDef)
                             {
                                 runtimeSortFilterEventInfo.SetEventSourceScope(isColumnAxis, this.SelfReference, rowIndex);
                             }
                         }
                         runtimeSortFilterEventInfo.AddDetailScopeInfo(isColumnAxis, this.SelfReference, rowIndex);
                     }
                 }
             }
         }
     }
 }
 protected bool DetailTargetScopeMatched(AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, IReference <IScope> outerScope, bool isColumnAxis, int index)
 {
     if (this.m_odpContext.RuntimeSortFilterInfo != null)
     {
         IReference <RuntimeSortFilterEventInfo> reference = this.m_odpContext.RuntimeSortFilterInfo[index];
         using (reference.PinValue())
         {
             RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
             if (runtimeSortFilterEventInfo != null)
             {
                 List <IReference <RuntimeDataRegionObj> > list = null;
                 List <int> list2 = null;
                 int        num   = -1;
                 if (isColumnAxis)
                 {
                     list  = runtimeSortFilterEventInfo.DetailColScopes;
                     list2 = runtimeSortFilterEventInfo.DetailColScopeIndices;
                     num   = dataRegionDef.CurrentColDetailIndex;
                 }
                 else
                 {
                     list  = runtimeSortFilterEventInfo.DetailRowScopes;
                     list2 = runtimeSortFilterEventInfo.DetailRowScopeIndices;
                     num   = dataRegionDef.CurrentRowDetailIndex;
                 }
                 if (list != null)
                 {
                     for (int i = 0; i < list.Count; i++)
                     {
                         if (this.SelfReference.Equals(list[i]) && num == list2[i])
                         {
                             return(true);
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
        internal void RegisterSortFilterExpressionScope(IReference <IScope> containerRef, IReference <RuntimeDataRegionObj> scopeRef, bool[] isSortFilterExpressionScope)
        {
            List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = m_runtimeSortFilterInfo;

            if (runtimeSortFilterInfo == null || isSortFilterExpressionScope == null || scopeRef == null)
            {
                return;
            }
            List <object>[] array = null;
            using (scopeRef.PinValue())
            {
                RuntimeDataRegionObj runtimeDataRegionObj = scopeRef.Value();
                using (containerRef.PinValue())
                {
                    IScope scope = containerRef.Value();
                    for (int i = 0; i < runtimeSortFilterInfo.Count; i++)
                    {
                        if (!isSortFilterExpressionScope[i] || !runtimeDataRegionObj.IsTargetForSort(i, detailSort: false) || !runtimeDataRegionObj.TargetScopeMatched(i, detailSort: false))
                        {
                            continue;
                        }
                        IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[i];
                        using (reference.PinValue())
                        {
                            RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                            if (array == null && runtimeSortFilterEventInfo.EventSource.UserSort.GroupsInSortTarget != null)
                            {
                                int index = 0;
                                array = new List <object> [runtimeSortFilterEventInfo.EventSource.UserSort.GroupsInSortTarget.Count];
                                runtimeDataRegionObj.GetScopeValues(runtimeSortFilterEventInfo.EventTarget, array, ref index);
                            }
                            runtimeSortFilterEventInfo.RegisterSortFilterExpressionScope(ref scope.SortFilterExpressionScopeInfoIndices[i], scopeRef, array, i);
                        }
                    }
                }
            }
        }
Beispiel #11
0
 public static void ProcessEventSources(OnDemandProcessingContext odpContext, IScope containingScope, List <IInScopeEventSource> inScopeEventSources)
 {
     if (inScopeEventSources != null && inScopeEventSources.Count != 0)
     {
         foreach (IInScopeEventSource inScopeEventSource in inScopeEventSources)
         {
             if (inScopeEventSource.UserSort != null)
             {
                 AspNetCore.ReportingServices.ReportIntermediateFormat.SortFilterEventInfo sortFilterEventInfo = new AspNetCore.ReportingServices.ReportIntermediateFormat.SortFilterEventInfo(inScopeEventSource);
                 sortFilterEventInfo.EventSourceScopeInfo = odpContext.GetScopeValues(inScopeEventSource.ContainingScopes, containingScope);
                 if (odpContext.TopLevelContext.NewSortFilterEventInfo == null)
                 {
                     odpContext.TopLevelContext.NewSortFilterEventInfo = new SortFilterEventInfoMap();
                 }
                 string text = InstancePathItem.GenerateUniqueNameString(inScopeEventSource.ID, inScopeEventSource.InstancePath);
                 odpContext.TopLevelContext.NewSortFilterEventInfo.Add(text, sortFilterEventInfo);
                 List <IReference <RuntimeSortFilterEventInfo> > list = odpContext.RuntimeSortFilterInfo;
                 if (list == null && odpContext.SubReportUniqueName == null)
                 {
                     list = odpContext.TopLevelContext.ReportRuntimeUserSortFilterInfo;
                 }
                 if (list != null)
                 {
                     for (int i = 0; i < list.Count; i++)
                     {
                         IReference <RuntimeSortFilterEventInfo> reference = list[i];
                         using (reference.PinValue())
                         {
                             RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                             runtimeSortFilterEventInfo.MatchEventSource(inScopeEventSource, text, containingScope, odpContext);
                         }
                     }
                 }
             }
         }
     }
 }
        private void ProcessUserSort(OnDemandProcessingContext odpContext, ref bool processed, ref bool canStop, ref bool processedAny)
        {
            List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = m_runtimeSortFilterInfo;

            for (int i = 0; i < runtimeSortFilterInfo.Count; i++)
            {
                IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[i];
                using (reference.PinValue())
                {
                    RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                    if (!runtimeSortFilterEventInfo.Processed)
                    {
                        runtimeSortFilterEventInfo.PrepareForSorting(odpContext);
                    }
                }
            }
            for (int j = 0; j < runtimeSortFilterInfo.Count; j++)
            {
                IReference <RuntimeSortFilterEventInfo> reference2 = runtimeSortFilterInfo[j];
                using (reference2.PinValue())
                {
                    RuntimeSortFilterEventInfo runtimeSortFilterEventInfo2 = reference2.Value();
                    if (!runtimeSortFilterEventInfo2.Processed)
                    {
                        if (runtimeSortFilterEventInfo2.ProcessSorting(odpContext))
                        {
                            processedAny = true;
                            processed    = true;
                            odpContext.FirstPassPostProcess();
                            return;
                        }
                        canStop = false;
                    }
                }
            }
        }
Beispiel #13
0
 public UserSortFilterTraversalContext(RuntimeSortFilterEventInfo eventInfo)
 {
     this.m_eventInfo = eventInfo;
 }
        private static List <Declaration> BuildDeclarations()
        {
            List <Declaration> list = new List <Declaration>(83);

            list.Add(Aggregate.GetDeclaration());
            list.Add(AggregateRow.GetDeclaration());
            list.Add(Avg.GetDeclaration());
            list.Add(BTree.GetDeclaration());
            list.Add(BTreeNode.GetDeclaration());
            list.Add(BTreeNodeTuple.GetDeclaration());
            list.Add(BTreeNodeTupleList.GetDeclaration());
            list.Add(BTreeNodeHierarchyObj.GetDeclaration());
            list.Add(CalculatedFieldWrapperImpl.GetDeclaration());
            list.Add(ChildLeafInfo.GetDeclaration());
            list.Add(Count.GetDeclaration());
            list.Add(CountDistinct.GetDeclaration());
            list.Add(CountRows.GetDeclaration());
            list.Add(DataAggregateObj.GetDeclaration());
            list.Add(DataAggregateObjResult.GetDeclaration());
            list.Add(DataRegionMemberInstance.GetDeclaration());
            list.Add(DataFieldRow.GetDeclaration());
            list.Add(FieldImpl.GetDeclaration());
            list.Add(First.GetDeclaration());
            list.Add(Last.GetDeclaration());
            list.Add(Max.GetDeclaration());
            list.Add(Min.GetDeclaration());
            list.Add(Previous.GetDeclaration());
            list.Add(RuntimeCell.GetDeclaration());
            list.Add(RuntimeCells.GetDeclaration());
            list.Add(RuntimeCellWithContents.GetDeclaration());
            list.Add(RuntimeChartCriCell.GetDeclaration());
            list.Add(RuntimeChartCriGroupLeafObj.GetDeclaration());
            list.Add(RuntimeChartCriObj.GetDeclaration());
            list.Add(RuntimeChartObj.GetDeclaration());
            list.Add(RuntimeCriObj.GetDeclaration());
            list.Add(RuntimeDataRegionObj.GetDeclaration());
            list.Add(RuntimeDataTablixObj.GetDeclaration());
            list.Add(RuntimeDataTablixGroupLeafObj.GetDeclaration());
            list.Add(RuntimeDataTablixGroupRootObj.GetDeclaration());
            list.Add(RuntimeDataTablixMemberObj.GetDeclaration());
            list.Add(RuntimeDataTablixWithScopedItemsObj.GetDeclaration());
            list.Add(RuntimeDataTablixWithScopedItemsGroupLeafObj.GetDeclaration());
            list.Add(RuntimeDetailObj.GetDeclaration());
            list.Add(RuntimeExpressionInfo.GetDeclaration());
            list.Add(RuntimeGroupLeafObj.GetDeclaration());
            list.Add(RuntimeGroupObj.GetDeclaration());
            list.Add(RuntimeGroupRootObj.GetDeclaration());
            list.Add(RuntimeGroupingObj.GetDeclaration());
            list.Add(RuntimeHierarchyObj.GetDeclaration());
            list.Add(RuntimeMemberObj.GetDeclaration());
            list.Add(RuntimeRDLDataRegionObj.GetDeclaration());
            list.Add(RuntimeRICollection.GetDeclaration());
            list.Add(RuntimeSortDataHolder.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.SortExpressionScopeInstanceHolder.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.SortFilterExpressionScopeObj.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.SortScopeValuesHolder.GetDeclaration());
            list.Add(RuntimeSortHierarchyObj.GetDeclaration());
            list.Add(RuntimeSortHierarchyObj.SortHierarchyStructure.GetDeclaration());
            list.Add(RuntimeDataRowSortHierarchyObj.GetDeclaration());
            list.Add(RuntimeTablixCell.GetDeclaration());
            list.Add(RuntimeTablixGroupLeafObj.GetDeclaration());
            list.Add(RuntimeTablixObj.GetDeclaration());
            list.Add(RuntimeUserSortTargetInfo.GetDeclaration());
            list.Add(ScopeInstance.GetDeclaration());
            list.Add(ScopeLookupTable.GetDeclaration());
            list.Add(StDev.GetDeclaration());
            list.Add(StDevP.GetDeclaration());
            list.Add(Sum.GetDeclaration());
            list.Add(Var.GetDeclaration());
            list.Add(VarBase.GetDeclaration());
            list.Add(VarP.GetDeclaration());
            list.Add(Filters.FilterKey.GetDeclaration());
            list.Add(RuntimeGaugePanelObj.GetDeclaration());
            list.Add(LookupMatches.GetDeclaration());
            list.Add(LookupMatchesWithRows.GetDeclaration());
            list.Add(LookupTable.GetDeclaration());
            list.Add(RuntimeMapDataRegionObj.GetDeclaration());
            list.Add(DataScopeInfo.GetDeclaration());
            list.Add(BucketedDataAggregateObjs.GetDeclaration());
            list.Add(DataAggregateObjBucket.GetDeclaration());
            list.Add(RuntimeGroupingObjHash.GetDeclaration());
            list.Add(RuntimeGroupingObjTree.GetDeclaration());
            list.Add(RuntimeGroupingObjDetail.GetDeclaration());
            list.Add(RuntimeGroupingObjDetailUserSort.GetDeclaration());
            list.Add(RuntimeGroupingObjLinkedList.GetDeclaration());
            list.Add(RuntimeGroupingObjNaturalGroup.GetDeclaration());
            return(list);
        }
        public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.Aggregate:
                persistObj = new Aggregate();
                break;

            case ObjectType.AggregateRow:
                persistObj = new AggregateRow();
                break;

            case ObjectType.Avg:
                persistObj = new Avg();
                break;

            case ObjectType.BTree:
                persistObj = new BTree();
                break;

            case ObjectType.BTreeNode:
                persistObj = new BTreeNode();
                break;

            case ObjectType.BTreeNodeTupleList:
                persistObj = new BTreeNodeTupleList();
                break;

            case ObjectType.BTreeNodeTuple:
                persistObj = new BTreeNodeTuple();
                break;

            case ObjectType.BTreeNodeHierarchyObj:
                persistObj = new BTreeNodeHierarchyObj();
                break;

            case ObjectType.CalculatedFieldWrapperImpl:
                persistObj = new CalculatedFieldWrapperImpl();
                break;

            case ObjectType.ChildLeafInfo:
                persistObj = new ChildLeafInfo();
                break;

            case ObjectType.Count:
                persistObj = new Count();
                break;

            case ObjectType.CountDistinct:
                persistObj = new CountDistinct();
                break;

            case ObjectType.CountRows:
                persistObj = new CountRows();
                break;

            case ObjectType.DataAggregateObj:
                persistObj = new DataAggregateObj();
                break;

            case ObjectType.DataAggregateObjResult:
                persistObj = new DataAggregateObjResult();
                break;

            case ObjectType.DataFieldRow:
                persistObj = new DataFieldRow();
                break;

            case ObjectType.DataRegionMemberInstance:
                persistObj = new DataRegionMemberInstance();
                break;

            case ObjectType.FieldImpl:
                persistObj = new FieldImpl();
                break;

            case ObjectType.First:
                persistObj = new First();
                break;

            case ObjectType.Last:
                persistObj = new Last();
                break;

            case ObjectType.Max:
                persistObj = new Max();
                break;

            case ObjectType.Min:
                persistObj = new Min();
                break;

            case ObjectType.Previous:
                persistObj = new Previous();
                break;

            case ObjectType.RuntimeCells:
                persistObj = new RuntimeCells();
                break;

            case ObjectType.RuntimeChartCriCell:
                persistObj = new RuntimeChartCriCell();
                break;

            case ObjectType.RuntimeChartCriGroupLeafObj:
                persistObj = new RuntimeChartCriGroupLeafObj();
                break;

            case ObjectType.RuntimeChartObj:
                persistObj = new RuntimeChartObj();
                break;

            case ObjectType.RuntimeGaugePanelObj:
                persistObj = new RuntimeGaugePanelObj();
                break;

            case ObjectType.RuntimeCriObj:
                persistObj = new RuntimeCriObj();
                break;

            case ObjectType.RuntimeDataTablixGroupRootObj:
                persistObj = new RuntimeDataTablixGroupRootObj();
                break;

            case ObjectType.RuntimeDataTablixMemberObj:
                persistObj = new RuntimeDataTablixMemberObj();
                break;

            case ObjectType.RuntimeExpressionInfo:
                persistObj = new RuntimeExpressionInfo();
                break;

            case ObjectType.RuntimeHierarchyObj:
                persistObj = new RuntimeHierarchyObj();
                break;

            case ObjectType.RuntimeRICollection:
                persistObj = new RuntimeRICollection();
                break;

            case ObjectType.RuntimeSortDataHolder:
                persistObj = new RuntimeSortDataHolder();
                break;

            case ObjectType.RuntimeSortFilterEventInfo:
                persistObj = new RuntimeSortFilterEventInfo();
                break;

            case ObjectType.RuntimeSortHierarchyObj:
                persistObj = new RuntimeSortHierarchyObj();
                break;

            case ObjectType.RuntimeDataRowSortHierarchyObj:
                persistObj = new RuntimeDataRowSortHierarchyObj();
                break;

            case ObjectType.RuntimeTablixCell:
                persistObj = new RuntimeTablixCell();
                break;

            case ObjectType.RuntimeTablixGroupLeafObj:
                persistObj = new RuntimeTablixGroupLeafObj();
                break;

            case ObjectType.RuntimeTablixObj:
                persistObj = new RuntimeTablixObj();
                break;

            case ObjectType.RuntimeUserSortTargetInfo:
                persistObj = new RuntimeUserSortTargetInfo();
                break;

            case ObjectType.ScopeLookupTable:
                persistObj = new ScopeLookupTable();
                break;

            case ObjectType.SortExpressionScopeInstanceHolder:
                persistObj = new RuntimeSortFilterEventInfo.SortExpressionScopeInstanceHolder();
                break;

            case ObjectType.SortFilterExpressionScopeObj:
                persistObj = new RuntimeSortFilterEventInfo.SortFilterExpressionScopeObj();
                break;

            case ObjectType.SortHierarchyStruct:
                persistObj = new RuntimeSortHierarchyObj.SortHierarchyStructure();
                break;

            case ObjectType.SortScopeValuesHolder:
                persistObj = new RuntimeSortFilterEventInfo.SortScopeValuesHolder();
                break;

            case ObjectType.StDev:
                persistObj = new StDev();
                break;

            case ObjectType.StDevP:
                persistObj = new StDevP();
                break;

            case ObjectType.StorageItem:
                persistObj = new StorageItem();
                break;

            case ObjectType.Sum:
                persistObj = new Sum();
                break;

            case ObjectType.Var:
                persistObj = new Var();
                break;

            case ObjectType.VarP:
                persistObj = new VarP();
                break;

            case ObjectType.FilterKey:
                persistObj = new Filters.FilterKey();
                break;

            case ObjectType.LookupMatches:
                persistObj = new LookupMatches();
                break;

            case ObjectType.LookupMatchesWithRows:
                persistObj = new LookupMatchesWithRows();
                break;

            case ObjectType.LookupTable:
                persistObj = new LookupTable();
                break;

            case ObjectType.Union:
                persistObj = new Union();
                break;

            case ObjectType.RuntimeMapDataRegionObj:
                persistObj = new RuntimeMapDataRegionObj();
                break;

            case ObjectType.DataScopeInfo:
                persistObj = new DataScopeInfo();
                break;

            case ObjectType.BucketedDataAggregateObjs:
                persistObj = new BucketedDataAggregateObjs();
                break;

            case ObjectType.DataAggregateObjBucket:
                persistObj = new DataAggregateObjBucket();
                break;

            case ObjectType.RuntimeGroupingObjHash:
                persistObj = new RuntimeGroupingObjHash();
                break;

            case ObjectType.RuntimeGroupingObjTree:
                persistObj = new RuntimeGroupingObjTree();
                break;

            case ObjectType.RuntimeGroupingObjDetail:
                persistObj = new RuntimeGroupingObjDetail();
                break;

            case ObjectType.RuntimeGroupingObjDetailUserSort:
                persistObj = new RuntimeGroupingObjDetailUserSort();
                break;

            case ObjectType.RuntimeGroupingObjLinkedList:
                persistObj = new RuntimeGroupingObjLinkedList();
                break;

            case ObjectType.RuntimeGroupingObjNaturalGroup:
                persistObj = new RuntimeGroupingObjNaturalGroup();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }
Beispiel #16
0
 protected RuntimeGroupRootObj(IReference <IScope> outerScope, Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode hierarchyDef, DataActions dataAction, OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportProcessing.ObjectType objectType)
     : base(odpContext, objectType, outerScope.Value().Depth + 1)
 {
     m_hierarchyRoot = (RuntimeHierarchyObjReference)m_selfReference;
     m_outerScope    = outerScope;
     m_hierarchyDef  = hierarchyDef;
     Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = hierarchyDef.Grouping;
     Global.Tracer.Assert(grouping != null, "(null != groupDef)");
     m_isDetailGroup = grouping.IsDetail;
     if (m_isDetailGroup)
     {
         m_expression = null;
     }
     else
     {
         m_expression = new RuntimeExpressionInfo(grouping.GroupExpressions, grouping.ExprHost, grouping.SortDirections, 0);
     }
     if (m_odpContext.RuntimeSortFilterInfo != null)
     {
         int count = m_odpContext.RuntimeSortFilterInfo.Count;
         using (outerScope.PinValue())
         {
             IScope scope = outerScope.Value();
             for (int i = 0; i < count; i++)
             {
                 IReference <RuntimeSortFilterEventInfo> reference = m_odpContext.RuntimeSortFilterInfo[i];
                 using (reference.PinValue())
                 {
                     RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                     if (runtimeSortFilterEventInfo.EventSource.ContainingScopes != null && runtimeSortFilterEventInfo.EventSource.ContainingScopes.Count != 0 && !runtimeSortFilterEventInfo.HasEventSourceScope && (!m_isDetailGroup || !runtimeSortFilterEventInfo.EventSource.IsSubReportTopLevelScope))
                     {
                         continue;
                     }
                     bool flag = false;
                     if (m_isDetailGroup)
                     {
                         if (!scope.TargetForNonDetailSort && IsTargetForSort(i, detailSort: true) && runtimeSortFilterEventInfo.EventTarget != base.SelfReference && scope.TargetScopeMatched(i, detailSort: true))
                         {
                             flag = true;
                             if (m_detailUserSortTargetInfo == null)
                             {
                                 m_detailUserSortTargetInfo = new RuntimeUserSortTargetInfo((IReference <IHierarchyObj>)base.SelfReference, i, reference);
                             }
                             else
                             {
                                 m_detailUserSortTargetInfo.AddSortInfo((IReference <IHierarchyObj>)base.SelfReference, i, reference);
                             }
                         }
                     }
                     else if (grouping.IsSortFilterExpressionScope != null)
                     {
                         flag = (grouping.IsSortFilterExpressionScope[i] && m_odpContext.UserSortFilterContext.InProcessUserSortPhase(i) && TargetScopeMatched(i, detailSort: false));
                     }
                     if (flag)
                     {
                         if (m_builtinSortOverridden == null)
                         {
                             m_builtinSortOverridden = new bool[count];
                         }
                         m_builtinSortOverridden[i] = true;
                     }
                 }
             }
         }
     }
     if (m_detailUserSortTargetInfo != null)
     {
         m_groupingType = RuntimeGroupingObj.GroupingTypes.DetailUserSort;
     }
     else if (grouping.GroupAndSort && !BuiltinSortOverridden)
     {
         m_groupingType = RuntimeGroupingObj.GroupingTypes.Sort;
     }
     else if (grouping.IsDetail && grouping.Parent == null && !BuiltinSortOverridden)
     {
         m_groupingType = RuntimeGroupingObj.GroupingTypes.Detail;
     }
     else if (grouping.NaturalGroup)
     {
         m_groupingType = RuntimeGroupingObj.GroupingTypes.NaturalGroup;
     }
     else
     {
         m_groupingType = RuntimeGroupingObj.GroupingTypes.Hash;
     }
     m_grouping = RuntimeGroupingObj.CreateGroupingObj(m_groupingType, this, objectType);
     if (grouping.Filters == null)
     {
         m_dataAction      = dataAction;
         m_outerDataAction = dataAction;
     }
     if (grouping.RecursiveAggregates != null)
     {
         m_dataAction |= DataActions.RecursiveAggregates;
     }
     if (grouping.PostSortAggregates != null)
     {
         m_dataAction |= DataActions.PostSortAggregates;
     }
     if (grouping.Parent != null)
     {
         m_parentExpression = new RuntimeExpressionInfo(grouping.Parent, grouping.ParentExprHost, null, 0);
     }
 }
 internal bool PopulateRuntimeSortFilterEventInfo(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet myDataSet)
 {
     if (odpContext.TopLevelContext.UserSortFilterInfo == null || odpContext.TopLevelContext.UserSortFilterInfo.OdpSortInfo == null || odpContext.TopLevelContext.OldSortFilterEventInfo == null)
     {
         return(false);
     }
     if (-1 != m_dataSetGlobalID)
     {
         return(false);
     }
     m_runtimeSortFilterInfo = null;
     EventInformation.OdpSortEventInfo odpSortInfo = odpContext.TopLevelContext.UserSortFilterInfo.OdpSortInfo;
     for (int i = 0; i < odpSortInfo.Count; i++)
     {
         string uniqueNameAt = odpSortInfo.GetUniqueNameAt(i);
         Microsoft.ReportingServices.ReportIntermediateFormat.SortFilterEventInfo sortFilterEventInfo = odpContext.TopLevelContext.OldSortFilterEventInfo[uniqueNameAt];
         if (sortFilterEventInfo == null || sortFilterEventInfo.EventSource.UserSort == null)
         {
             continue;
         }
         int num = sortFilterEventInfo.EventSource.UserSort.SubReportDataSetGlobalId;
         if (-1 == num)
         {
             num = sortFilterEventInfo.EventSource.UserSort.DataSet.GlobalID;
         }
         if (num == myDataSet.GlobalID)
         {
             if (m_runtimeSortFilterInfo == null)
             {
                 m_runtimeSortFilterInfo = new List <IReference <RuntimeSortFilterEventInfo> >();
             }
             RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = new RuntimeSortFilterEventInfo(sortFilterEventInfo.EventSource, uniqueNameAt, odpSortInfo.GetSortDirectionAt(i), sortFilterEventInfo.EventSourceScopeInfo, odpContext, (m_currentContainingScope == null) ? 1 : m_currentContainingScope.Value().Depth);
             runtimeSortFilterEventInfo.SelfReference.UnPinValue();
             m_runtimeSortFilterInfo.Add(runtimeSortFilterEventInfo.SelfReference);
         }
     }
     if (m_runtimeSortFilterInfo != null)
     {
         int count = m_runtimeSortFilterInfo.Count;
         for (int j = 0; j < count; j++)
         {
             IReference <RuntimeSortFilterEventInfo> reference = m_runtimeSortFilterInfo[j];
             using (reference.PinValue())
             {
                 RuntimeSortFilterEventInfo runtimeSortFilterEventInfo2 = reference.Value();
                 IInScopeEventSource        eventSource = runtimeSortFilterEventInfo2.EventSource;
                 Microsoft.ReportingServices.ReportIntermediateFormat.ISortFilterScope sortExpressionScope = eventSource.UserSort.SortExpressionScope;
                 if (sortExpressionScope != null)
                 {
                     sortExpressionScope.IsSortFilterExpressionScope = SetSortFilterInfo(sortExpressionScope.IsSortFilterExpressionScope, count, j);
                 }
                 Microsoft.ReportingServices.ReportIntermediateFormat.ISortFilterScope sortTarget = eventSource.UserSort.SortTarget;
                 if (sortTarget != null)
                 {
                     sortTarget.IsSortFilterTarget = SetSortFilterInfo(sortTarget.IsSortFilterTarget, count, j);
                 }
                 if (eventSource.ContainingScopes != null && 0 < eventSource.ContainingScopes.Count)
                 {
                     int num2 = 0;
                     int num3 = 0;
                     for (int k = 0; k < eventSource.ContainingScopes.Count; k++)
                     {
                         Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = eventSource.ContainingScopes[k];
                         if (grouping != null && grouping.IsDetail)
                         {
                             continue;
                         }
                         List <object> list = runtimeSortFilterEventInfo2.SortSourceScopeInfo[num2];
                         if (grouping != null)
                         {
                             if (grouping.SortFilterScopeInfo == null)
                             {
                                 grouping.SortFilterScopeInfo = new List <object> [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]  = list;
                             grouping.SortFilterScopeIndex[j] = num2;
                         }
                         else
                         {
                             List <Microsoft.ReportingServices.ReportIntermediateFormat.SubReport> detailScopeSubReports = eventSource.UserSort.DetailScopeSubReports;
                             Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem       reportItem            = (detailScopeSubReports == null || num3 >= detailScopeSubReports.Count) ? eventSource.Parent : detailScopeSubReports[num3++].Parent;
                             while (reportItem != null && !reportItem.IsDataRegion)
                             {
                                 reportItem = reportItem.Parent;
                             }
                             Global.Tracer.Assert(reportItem.IsDataRegion, "(parent.IsDataRegion)");
                             Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)reportItem;
                             if (dataRegion.SortFilterSourceDetailScopeInfo == null)
                             {
                                 dataRegion.SortFilterSourceDetailScopeInfo = new int[count];
                                 for (int n = 0; n < count; n++)
                                 {
                                     dataRegion.SortFilterSourceDetailScopeInfo[n] = -1;
                                 }
                             }
                             Global.Tracer.Assert(list != null && 1 == list.Count, "(null != scopeValues && 1 == scopeValues.Count)");
                             dataRegion.SortFilterSourceDetailScopeInfo[j] = (int)list[0];
                         }
                         num2++;
                     }
                 }
                 Microsoft.ReportingServices.ReportIntermediateFormat.GroupingList groupsInSortTarget = eventSource.UserSort.GroupsInSortTarget;
                 if (groupsInSortTarget != null)
                 {
                     for (int num4 = 0; num4 < groupsInSortTarget.Count; num4++)
                     {
                         groupsInSortTarget[num4].NeedScopeInfoForSortFilterExpression = SetSortFilterInfo(groupsInSortTarget[num4].NeedScopeInfoForSortFilterExpression, count, j);
                     }
                 }
                 List <int> peerSortFilters = eventSource.GetPeerSortFilters(create: false);
                 if (peerSortFilters == null || peerSortFilters.Count == 0)
                 {
                     continue;
                 }
                 if (runtimeSortFilterEventInfo2.PeerSortFilters == null)
                 {
                     runtimeSortFilterEventInfo2.PeerSortFilters = new Hashtable();
                 }
                 for (int num5 = 0; num5 < peerSortFilters.Count; num5++)
                 {
                     if (eventSource.ID != peerSortFilters[num5])
                     {
                         runtimeSortFilterEventInfo2.PeerSortFilters.Add(peerSortFilters[num5], null);
                     }
                 }
             }
         }
     }
     return(true);
 }