protected Hashtable GetScopeNames(RuntimeDataRegionObjReference currentScope, Dictionary <string, object> nameValuePairs)
        {
            Hashtable hashtable = new Hashtable();
            IScope    scope     = null;

            for (IReference <IScope> reference = currentScope; reference != null; reference = scope.GetOuterScope(false))
            {
                scope = reference.Value();
                string scopeName = scope.GetScopeName();
                if (scopeName != null)
                {
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = null;
                    if (scope is RuntimeGroupLeafObj)
                    {
                        grouping = ((RuntimeGroupLeafObj)scope).GroupingDef;
                        RuntimeDataRegionObj.AddGroupNameValuePair(this.m_odpContext, grouping, nameValuePairs);
                    }
                    hashtable.Add(scopeName, grouping);
                }
                else if (scope is RuntimeTablixCell)
                {
                    scope.GetGroupNameValuePairs(nameValuePairs);
                }
            }
            return(hashtable);
        }
        protected Hashtable GetScopeNames(RuntimeDataRegionObjReference currentScope, string targetScope, out bool inScope)
        {
            inScope = false;
            Hashtable hashtable = new Hashtable();
            IScope    scope     = null;

            for (IReference <IScope> reference = currentScope; reference != null; reference = scope.GetOuterScope(false))
            {
                scope = reference.Value();
                string scopeName = scope.GetScopeName();
                if (scopeName != null)
                {
                    if (!inScope && scopeName.Equals(targetScope))
                    {
                        inScope = true;
                    }
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping value = null;
                    if (scope is RuntimeGroupLeafObj)
                    {
                        value = ((RuntimeGroupLeafObj)scope).GroupingDef;
                    }
                    hashtable.Add(scopeName, value);
                }
                else if (scope is RuntimeTablixCell && !inScope)
                {
                    inScope = scope.InScope(targetScope);
                }
            }
            return(hashtable);
        }
        protected Hashtable GetScopeNames(RuntimeDataRegionObjReference currentScope, string targetScope, out int level)
        {
            level = -1;
            Hashtable hashtable = new Hashtable();
            IScope    scope     = null;

            for (IReference <IScope> reference = currentScope; reference != null; reference = scope.GetOuterScope(false))
            {
                scope = reference.Value();
                string scopeName = scope.GetScopeName();
                if (scopeName != null)
                {
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = null;
                    if (scope is RuntimeGroupLeafObj)
                    {
                        grouping = ((RuntimeGroupLeafObj)scope).GroupingDef;
                        if (-1 == level && scopeName.Equals(targetScope))
                        {
                            level = grouping.RecursiveLevel;
                        }
                    }
                    hashtable.Add(scopeName, grouping);
                }
                else if (scope is RuntimeTablixCell && -1 == level)
                {
                    level = scope.RecursiveLevel(targetScope);
                }
            }
            return(hashtable);
        }
 protected InternalStreamingOdpDynamicMemberLogicBase(DataRegionMember memberDef, OnDemandProcessingContext odpContext)
 {
     this.m_memberDef = memberDef;
     this.m_sorting   = this.m_memberDef.DataRegionMemberDefinition.Sorting;
     this.m_grouping  = this.m_memberDef.DataRegionMemberDefinition.Grouping;
     this.m_memberGroupAndSortExpressionFlag = this.m_memberDef.DataRegionMemberDefinition.MemberGroupAndSortExpressionFlag;
     this.m_odpContext = odpContext;
 }
 public GroupExpressionCollection(AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping)
 {
     if (grouping == null || grouping.GroupExpressions == null)
     {
         this.m_list = new List <ReportVariantProperty>();
     }
     else
     {
         int count = grouping.GroupExpressions.Count;
         this.m_list = new List <ReportVariantProperty>(count);
         for (int i = 0; i < count; i++)
         {
             this.m_list.Add(new ReportVariantProperty(grouping.GroupExpressions[i]));
         }
     }
 }
 protected int DataRegionRecursiveLevel(AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, string scope)
 {
     if (scope == null)
     {
         return(-1);
     }
     if (dataRegionDef.ScopeNames == null)
     {
         int result = default(int);
         dataRegionDef.ScopeNames = this.GetScopeNames(this.SelfReference, scope, out result);
         return(result);
     }
     AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = dataRegionDef.ScopeNames[scope] as AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping;
     if (grouping != null)
     {
         return(grouping.RecursiveLevel);
     }
     return(-1);
 }
 public void InsertToSortTree(RuntimeGroupLeafObjReference groupLeaf)
 {
     using (base.m_hierarchyRoot.PinValue())
     {
         RuntimeGroupRootObj runtimeGroupRootObj = (RuntimeGroupRootObj)base.m_hierarchyRoot.Value();
         AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = runtimeGroupRootObj.HierarchyDef.Grouping;
         if (runtimeGroupRootObj.ProcessSecondPassSorting)
         {
             Global.Tracer.Assert(base.m_grouping != null, "(m_grouping != null)");
             runtimeGroupRootObj.LastChild = groupLeaf;
             Global.Tracer.Assert(null != grouping, "(null != groupingDef)");
             object keyValue = base.m_odpContext.ReportRuntime.EvaluateRuntimeExpression(base.m_expression, AspNetCore.ReportingServices.ReportProcessing.ObjectType.Grouping, grouping.Name, "Sort");
             base.m_grouping.NextRow(keyValue);
         }
         else
         {
             Global.Tracer.Assert(runtimeGroupRootObj.HierarchyDef.HasFilters || runtimeGroupRootObj.HierarchyDef.HasInnerFilters, "(groupRoot.HierarchyDef.HasFilters || groupRoot.HierarchyDef.HasInnerFilters)");
             this.AddChild(groupLeaf);
         }
     }
 }
Exemplo n.º 8
0
 protected void MatchSortFilterScope(IReference <IScope> outerScope, AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping groupDef, object groupExprValue, int groupExprIndex)
 {
     if (base.m_odpContext.RuntimeSortFilterInfo != null && groupDef.SortFilterScopeInfo != null)
     {
         List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = base.m_odpContext.RuntimeSortFilterInfo;
         for (int i = 0; i < runtimeSortFilterInfo.Count; i++)
         {
             List <object> list = groupDef.SortFilterScopeInfo[i];
             if (list != null && outerScope.Value().TargetScopeMatched(i, false))
             {
                 if (base.m_odpContext.ProcessingComparer.Compare(list[groupExprIndex], groupExprValue) != 0)
                 {
                     groupDef.SortFilterScopeMatched[i] = false;
                 }
             }
             else
             {
                 groupDef.SortFilterScopeMatched[i] = false;
             }
         }
     }
 }
 public static void AddGroupNameValuePair(OnDemandProcessingContext odpContext, AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping, Dictionary <string, object> nameValuePairs)
 {
     if (grouping != null)
     {
         Global.Tracer.Assert(grouping.GroupExpressions != null && 0 < grouping.GroupExpressions.Count);
         AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
         if (expressionInfo.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
         {
             try
             {
                 FieldImpl fieldImpl = odpContext.ReportObjectModel.FieldsImpl[expressionInfo.IntValue];
                 if (fieldImpl.FieldDef != null)
                 {
                     object value = fieldImpl.Value;
                     if (!nameValuePairs.ContainsKey(fieldImpl.FieldDef.DataField))
                     {
                         nameValuePairs.Add(fieldImpl.FieldDef.DataField, (value is DBNull) ? null : value);
                     }
                 }
             }
             catch (Exception e)
             {
                 if (!AsynchronousExceptionDetection.IsStoppingException(e))
                 {
                     goto end_IL_0097;
                 }
                 throw;
                 end_IL_0097 :;
             }
         }
     }
 }
        private void SetupObjectModels(OnDemandMode mode, bool needDeepCopyPath, int moveNextInstanceIndex, string scopeName)
        {
            AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegionInstance dataRegionInstance = null;
            IMemberHierarchy memberHierarchy         = null;
            int                     num              = -1;
            ScopeInstance           scopeInstance    = base.m_odpContext.CurrentReportInstance;
            List <InstancePathItem> lastInstancePath = this.m_lastInstancePath;
            List <InstancePathItem> list             = null;
            int                     num2             = 0;

            AspNetCore.ReportingServices.ReportIntermediateFormat.Report reportDefinition = base.m_odpContext.ReportDefinition;
            ObjectModelImpl reportObjectModel = base.m_odpContext.ReportObjectModel;
            bool            flag  = false;
            bool            flag2 = false;
            int             num3  = 0;

            try
            {
                if (this.m_lastRIFObject.InstancePath != null)
                {
                    list = this.m_lastRIFObject.InstancePath;
                    num2 = list.Count;
                }
                if (mode != OnDemandMode.InScope)
                {
                    base.m_odpContext.EnsureCultureIsSetOnCurrentThread();
                }
                if (mode != OnDemandMode.InScope || 1 != reportDefinition.DataSetsNotOnlyUsedInParameters || !this.InScopeCompare(reportDefinition.FirstDataSet.Name, scopeName))
                {
                    int num4 = 0;
                    if (base.m_odpContext.InSubreport)
                    {
                        num4 = InstancePathItem.GetParentReportIndex(this.m_lastRIFObject.InstancePath, this.m_lastRIFObject.InstancePathItem.Type == InstancePathItemType.SubReport);
                    }
                    bool flag3           = default(bool);
                    int  sharedPathIndex = InstancePathItem.GetSharedPathIndex(num4, lastInstancePath, list, reportObjectModel.AllFieldsCleared, out flag3);
                    for (int i = this.m_specialLastGroupingValues.Count; i < num4; i++)
                    {
                        this.m_specialLastGroupingValues.Add(null);
                    }
                    for (int j = num4; j < num2; j++)
                    {
                        InstancePathItem instancePathItem = list[j];
                        bool             flag4            = false;
                        if (mode != OnDemandMode.InScope)
                        {
                            flag4 = (j <= sharedPathIndex);
                        }
                        if (!flag4 && mode == OnDemandMode.FullSetup)
                        {
                            if (this.m_specialLastGroupingValues.Count < num2)
                            {
                                this.m_specialLastGroupingValues.Add(null);
                            }
                            else
                            {
                                this.m_specialLastGroupingValues[j] = null;
                            }
                        }
                        switch (instancePathItem.Type)
                        {
                        case InstancePathItemType.SubReport:
                            if (scopeInstance.SubreportInstances != null && instancePathItem.IndexInCollection < scopeInstance.SubreportInstances.Count)
                            {
                                IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = scopeInstance.SubreportInstances[instancePathItem.IndexInCollection];
                                using (reference.PinValue())
                                {
                                    AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = reference.Value();
                                    subReportInstance.SubReportDef.CurrentSubReportInstance = reference;
                                    if (mode != OnDemandMode.InScope && !subReportInstance.Initialized)
                                    {
                                        if (base.m_odpContext.IsTablixProcessingMode || base.m_odpContext.IsTopLevelSubReportProcessing)
                                        {
                                            return;
                                        }
                                        SubReportInitializer.InitializeSubReport(subReportInstance.SubReportDef);
                                        reference.PinValue();
                                    }
                                    Global.Tracer.Assert(j == num2 - 1, "SubReport not last in instance path.");
                                }
                            }
                            goto default;

                        case InstancePathItemType.DataRegion:
                            if (scopeInstance is AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance && (scopeInstance.DataRegionInstances == null || scopeInstance.DataRegionInstances.Count <= instancePathItem.IndexInCollection || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection] == null || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value() == null))
                            {
                                Global.Tracer.Assert(instancePathItem.IndexInCollection < reportDefinition.TopLevelDataRegions.Count, "(newItem.IndexInCollection < m_reportDefinition.TopLevelDataRegions.Count)");
                                AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = reportDefinition.TopLevelDataRegions[instancePathItem.IndexInCollection];
                                AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet    dataSet    = dataRegion.GetDataSet(reportDefinition);
                                if (mode == OnDemandMode.InScope && this.InScopeCompare(dataSet.Name, scopeName))
                                {
                                    return;
                                }
                                this.PerformOnDemandTablixProcessing(dataSet);
                            }
                            scopeInstance      = scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value();
                            flag               = (this.m_inRecursiveColumnHierarchy = false);
                            flag2              = (this.m_inRecursiveRowHierarchy = false);
                            num                = -1;
                            dataRegionInstance = (scopeInstance as AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegionInstance);
                            memberHierarchy    = dataRegionInstance;
                            if (mode == OnDemandMode.InScope && this.InScopeCompare(dataRegionInstance.DataRegionDef.Name, scopeName))
                            {
                                return;
                            }
                            if (dataRegionInstance.DataSetIndexInCollection >= 0 && base.m_odpContext.CurrentDataSetIndex != dataRegionInstance.DataSetIndexInCollection && mode != OnDemandMode.InScope)
                            {
                                if (!flag4)
                                {
                                    AspNetCore.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance = base.m_odpContext.CurrentReportInstance.GetDataSetInstance(dataRegionInstance.DataSetIndexInCollection, base.m_odpContext);
                                    if (dataSetInstance != null)
                                    {
                                        dataSetInstance.SetupEnvironment(base.m_odpContext, true);
                                        num3 = 0;
                                    }
                                }
                                else
                                {
                                    num3 = j + 1;
                                }
                            }
                            if (mode != OnDemandMode.InScope)
                            {
                                if (!flag4)
                                {
                                    dataRegionInstance.SetupEnvironment(base.m_odpContext);
                                    num3 = 0;
                                    if (!dataRegionInstance.NoRows)
                                    {
                                        dataRegionInstance.DataRegionDef.NoRows = false;
                                        goto default;
                                    }
                                    dataRegionInstance.DataRegionDef.NoRows = true;
                                    dataRegionInstance.DataRegionDef.ResetTopLevelDynamicMemberInstanceCount();
                                    return;
                                }
                                num3 = j + 1;
                            }
                            goto default;

                        case InstancePathItemType.ColumnMemberInstanceIndexTopMost:
                            scopeInstance = dataRegionInstance;
                            goto default;

                        case InstancePathItemType.Cell:
                        {
                            if (-1 == num)
                            {
                                num = 0;
                            }
                            IList <AspNetCore.ReportingServices.ReportIntermediateFormat.DataCellInstance> cellInstances = memberHierarchy.GetCellInstances(num);
                            if (cellInstances == null)
                            {
                                if (flag2 && flag)
                                {
                                    reportObjectModel.ResetFieldValues();
                                }
                            }
                            else if (cellInstances.Count > instancePathItem.IndexInCollection)
                            {
                                AspNetCore.ReportingServices.ReportIntermediateFormat.DataCellInstance dataCellInstance = cellInstances[instancePathItem.IndexInCollection];
                                if (dataCellInstance != null)
                                {
                                    scopeInstance = dataCellInstance;
                                    if (!flag4)
                                    {
                                        dataCellInstance.SetupEnvironment(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex);
                                        num3 = 0;
                                    }
                                    else
                                    {
                                        num3 = j + 1;
                                    }
                                }
                            }
                            goto default;
                        }

                        default:
                            if (instancePathItem.IsDynamicMember)
                            {
                                IList <DataRegionMemberInstance> childMemberInstances = ((IMemberHierarchy)scopeInstance).GetChildMemberInstances(instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex, instancePathItem.IndexInCollection);
                                if (childMemberInstances == null)
                                {
                                    reportObjectModel.ResetFieldValues();
                                    return;
                                }
                                int num5 = (j != num2 - 1 || moveNextInstanceIndex < 0 || moveNextInstanceIndex >= childMemberInstances.Count) ? ((instancePathItem.InstanceIndex >= 0) ? instancePathItem.InstanceIndex : 0) : moveNextInstanceIndex;
                                if (num5 >= childMemberInstances.Count)
                                {
                                    instancePathItem.ResetContext();
                                    num5 = 0;
                                }
                                DataRegionMemberInstance dataRegionMemberInstance = childMemberInstances[num5];
                                if (mode == OnDemandMode.FullSetup)
                                {
                                    dataRegionMemberInstance.MemberDef.InstanceCount      = childMemberInstances.Count;
                                    dataRegionMemberInstance.MemberDef.CurrentMemberIndex = num5;
                                }
                                scopeInstance             = dataRegionMemberInstance;
                                this.m_lastRecursiveLevel = dataRegionMemberInstance.RecursiveLevel;
                                AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode memberDef = dataRegionMemberInstance.MemberDef;
                                if (mode == OnDemandMode.InScope && this.InScopeCompare(memberDef.Grouping.Name, scopeName))
                                {
                                    return;
                                }
                                if (instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex)
                                {
                                    memberHierarchy = dataRegionMemberInstance;
                                    flag2           = true;
                                }
                                else
                                {
                                    num  = dataRegionMemberInstance.MemberInstanceIndexWithinScopeLevel;
                                    flag = true;
                                }
                                if (mode == OnDemandMode.FullSetup && !flag4)
                                {
                                    dataRegionMemberInstance.SetupEnvironment(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex);
                                    num3 = 0;
                                    AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = memberDef.Grouping;
                                    if (grouping.Parent != null)
                                    {
                                        if (memberDef.IsColumn)
                                        {
                                            this.m_inRecursiveColumnHierarchy = true;
                                        }
                                        else
                                        {
                                            this.m_inRecursiveRowHierarchy = true;
                                        }
                                        if (memberDef.IsTablixMember)
                                        {
                                            memberDef.SetMemberInstances(childMemberInstances);
                                            memberDef.SetRecursiveParentIndex(dataRegionMemberInstance.RecursiveParentIndex);
                                            memberDef.SetInstanceHasRecursiveChildren(dataRegionMemberInstance.HasRecursiveChildren);
                                        }
                                    }
                                    else if (memberDef.IsColumn)
                                    {
                                        this.m_inRecursiveColumnHierarchy = false;
                                    }
                                    else
                                    {
                                        this.m_inRecursiveRowHierarchy = false;
                                    }
                                    grouping.RecursiveLevel = this.m_lastRecursiveLevel;
                                    grouping.SetGroupInstanceExpressionValues(dataRegionMemberInstance.GroupExprValues);
                                    if (mode == OnDemandMode.FullSetup && grouping != null && grouping.GroupExpressions != null && grouping.GroupExpressions.Count > 0)
                                    {
                                        AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
                                        if (expressionInfo.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
                                        {
                                            AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet2 = memberDef.DataRegionDef.GetDataSet(reportDefinition);
                                            AspNetCore.ReportingServices.ReportIntermediateFormat.Field   field    = dataSet2.Fields[expressionInfo.IntValue];
                                            if (field.DataField != null)
                                            {
                                                string dataField = field.DataField;
                                                object second    = dataRegionMemberInstance.GroupExprValues[0];
                                                PairObj <string, object> pairObj = this.m_specialLastGroupingValues[j];
                                                if (pairObj == null)
                                                {
                                                    pairObj = new PairObj <string, object>(dataField, second);
                                                    this.m_specialLastGroupingValues[j] = pairObj;
                                                }
                                                else
                                                {
                                                    pairObj.First  = dataField;
                                                    pairObj.Second = second;
                                                }
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    num3 = j + 1;
                                }
                            }
                            break;

                        case InstancePathItemType.None:
                            break;
                        }
                    }
                    if (mode == OnDemandMode.FullSetup && !flag3 && scopeInstance != null && num3 > 0)
                    {
                        while (num3 < this.m_lastInstancePath.Count)
                        {
                            if (!this.m_lastInstancePath[num3].IsScope)
                            {
                                num3++;
                                continue;
                            }
                            scopeInstance.SetupFields(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex);
                            break;
                        }
                    }
                    if (mode == OnDemandMode.FullSetup && !base.m_odpContext.IsTablixProcessingMode && base.m_odpContext.CurrentReportInstance != null && dataRegionInstance == null && reportDefinition.DataSetsNotOnlyUsedInParameters == 1)
                    {
                        AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet         firstDataSet     = reportDefinition.FirstDataSet;
                        AspNetCore.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance2 = base.m_odpContext.CurrentReportInstance.GetDataSetInstance(firstDataSet, base.m_odpContext);
                        if (dataSetInstance2 != null)
                        {
                            bool flag5 = true;
                            if (!base.m_odpContext.IsTablixProcessingComplete(firstDataSet.IndexInCollection))
                            {
                                this.PerformOnDemandTablixProcessing(firstDataSet);
                                flag5 = false;
                            }
                            if (base.m_odpContext.CurrentOdpDataSetInstance == dataSetInstance2)
                            {
                                flag5 = false;
                            }
                            if (flag5)
                            {
                                dataSetInstance2.SetupEnvironment(base.m_odpContext, true);
                            }
                            else if (!dataSetInstance2.NoRows)
                            {
                                dataSetInstance2.SetupFields(base.m_odpContext, dataSetInstance2);
                            }
                        }
                    }
                }
            }
            finally
            {
                if (needDeepCopyPath)
                {
                    InstancePathItem.DeepCopyPath(list, ref this.m_lastInstancePath);
                }
            }
        }
Exemplo n.º 11
0
        public override void NextRow()
        {
            bool flag = true;
            RuntimeGroupRootObj runtimeGroupRootObj = null;

            using (this.m_hierarchyRoot.PinValue())
            {
                if (this.m_hierarchyRoot is RuntimeGroupRootObjReference)
                {
                    runtimeGroupRootObj = (RuntimeGroupRootObj)this.m_hierarchyRoot.Value();
                    if (ProcessingStages.SortAndFilter == runtimeGroupRootObj.ProcessingStage)
                    {
                        flag = false;
                    }
                }
                if (this.m_hierarchyObjs != null)
                {
                    if (flag)
                    {
                        IReference <RuntimeHierarchyObj> reference = this.m_hierarchyObjs[0];
                        Global.Tracer.Assert(null != reference, "(null != hierarchyObj)");
                        using (reference.PinValue())
                        {
                            reference.Value().NextRow();
                        }
                    }
                    else if (runtimeGroupRootObj != null)
                    {
                        RuntimeGroupLeafObjReference lastChild = runtimeGroupRootObj.LastChild;
                        Global.Tracer.Assert((BaseReference)null != (object)lastChild, "(null != groupLastChild)");
                        this.m_hierarchyObjs.Add(lastChild);
                    }
                }
                else if (this.m_grouping != null)
                {
                    AspNetCore.ReportingServices.ReportProcessing.ObjectType objectType = runtimeGroupRootObj.HierarchyDef.DataRegionDef.ObjectType;
                    string             name               = runtimeGroupRootObj.HierarchyDef.DataRegionDef.Name;
                    string             propertyName       = "GroupExpression";
                    DomainScopeContext domainScopeContext = base.OdpContext.DomainScopeContext;
                    DomainScopeContext.DomainScopeInfo domainScopeInfo = null;
                    if (domainScopeContext != null)
                    {
                        domainScopeInfo = domainScopeContext.CurrentDomainScope;
                    }
                    object obj;
                    if (domainScopeInfo != null)
                    {
                        domainScopeInfo.MoveNext();
                        obj = domainScopeInfo.CurrentKey;
                    }
                    else
                    {
                        obj = ((this.m_expression != null) ? base.m_odpContext.ReportRuntime.EvaluateRuntimeExpression(this.m_expression, objectType, name, propertyName) : ((object)base.m_odpContext.ReportObjectModel.FieldsImpl.GetRowIndex()));
                    }
                    if (runtimeGroupRootObj != null && flag)
                    {
                        AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = runtimeGroupRootObj.HierarchyDef.Grouping;
                        if (runtimeGroupRootObj.SaveGroupExprValues)
                        {
                            grouping.CurrentGroupExpressionValues.Add(obj);
                        }
                        this.MatchSortFilterScope(runtimeGroupRootObj.SelfReference, grouping, obj, this.m_expression.ExpressionIndex);
                    }
                    this.m_grouping.NextRow(obj);
                    if (domainScopeInfo != null)
                    {
                        domainScopeInfo.MovePrevious();
                    }
                }
            }
        }
Exemplo n.º 12
0
 public override void CreateDomainScopeMember(ReportHierarchyNode parentNode, Grouping grouping, AutomaticSubtotalContext context)
 {
     Global.Tracer.Assert(false, "CreateDomainScopeMember should not be called for MapDataRegion");
 }
Exemplo n.º 13
0
 public bool PopulateRuntimeSortFilterEventInfo(OnDemandProcessingContext odpContext, AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet myDataSet)
 {
     if (odpContext.TopLevelContext.UserSortFilterInfo != null && odpContext.TopLevelContext.UserSortFilterInfo.OdpSortInfo != null && odpContext.TopLevelContext.OldSortFilterEventInfo != null)
     {
         if (-1 != this.m_dataSetGlobalID)
         {
             return(false);
         }
         this.m_runtimeSortFilterInfo = null;
         EventInformation.OdpSortEventInfo odpSortInfo = odpContext.TopLevelContext.UserSortFilterInfo.OdpSortInfo;
         for (int i = 0; i < odpSortInfo.Count; i++)
         {
             string uniqueNameAt = odpSortInfo.GetUniqueNameAt(i);
             AspNetCore.ReportingServices.ReportIntermediateFormat.SortFilterEventInfo sortFilterEventInfo = odpContext.TopLevelContext.OldSortFilterEventInfo[uniqueNameAt];
             if (sortFilterEventInfo != null && sortFilterEventInfo.EventSource.UserSort != null)
             {
                 int num = sortFilterEventInfo.EventSource.UserSort.SubReportDataSetGlobalId;
                 if (-1 == num)
                 {
                     num = sortFilterEventInfo.EventSource.UserSort.DataSet.GlobalID;
                 }
                 if (num == myDataSet.GlobalID)
                 {
                     if (this.m_runtimeSortFilterInfo == null)
                     {
                         this.m_runtimeSortFilterInfo = new List <IReference <RuntimeSortFilterEventInfo> >();
                     }
                     RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = new RuntimeSortFilterEventInfo(sortFilterEventInfo.EventSource, uniqueNameAt, odpSortInfo.GetSortDirectionAt(i), sortFilterEventInfo.EventSourceScopeInfo, odpContext, (this.m_currentContainingScope == null) ? 1 : this.m_currentContainingScope.Value().Depth);
                     runtimeSortFilterEventInfo.SelfReference.UnPinValue();
                     this.m_runtimeSortFilterInfo.Add(runtimeSortFilterEventInfo.SelfReference);
                 }
             }
         }
         if (this.m_runtimeSortFilterInfo != null)
         {
             int count = this.m_runtimeSortFilterInfo.Count;
             for (int j = 0; j < count; j++)
             {
                 IReference <RuntimeSortFilterEventInfo> reference = this.m_runtimeSortFilterInfo[j];
                 using (reference.PinValue())
                 {
                     RuntimeSortFilterEventInfo runtimeSortFilterEventInfo2 = reference.Value();
                     IInScopeEventSource        eventSource = runtimeSortFilterEventInfo2.EventSource;
                     AspNetCore.ReportingServices.ReportIntermediateFormat.ISortFilterScope sortExpressionScope = eventSource.UserSort.SortExpressionScope;
                     if (sortExpressionScope != null)
                     {
                         sortExpressionScope.IsSortFilterExpressionScope = this.SetSortFilterInfo(sortExpressionScope.IsSortFilterExpressionScope, count, j);
                     }
                     AspNetCore.ReportingServices.ReportIntermediateFormat.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 num2 = 0;
                         int num3 = 0;
                         for (int k = 0; k < eventSource.ContainingScopes.Count; k++)
                         {
                             AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = eventSource.ContainingScopes[k];
                             if (grouping == null || !grouping.IsDetail)
                             {
                                 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 <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport> detailScopeSubReports = eventSource.UserSort.DetailScopeSubReports;
                                     AspNetCore.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)");
                                     AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (AspNetCore.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++;
                             }
                         }
                     }
                     AspNetCore.ReportingServices.ReportIntermediateFormat.GroupingList groupsInSortTarget = eventSource.UserSort.GroupsInSortTarget;
                     if (groupsInSortTarget != null)
                     {
                         for (int num5 = 0; num5 < groupsInSortTarget.Count; num5++)
                         {
                             groupsInSortTarget[num5].NeedScopeInfoForSortFilterExpression = this.SetSortFilterInfo(groupsInSortTarget[num5].NeedScopeInfoForSortFilterExpression, count, j);
                         }
                     }
                     List <int> peerSortFilters = eventSource.GetPeerSortFilters(false);
                     if (peerSortFilters != null && peerSortFilters.Count != 0)
                     {
                         if (runtimeSortFilterEventInfo2.PeerSortFilters == null)
                         {
                             runtimeSortFilterEventInfo2.PeerSortFilters = new Hashtable();
                         }
                         for (int num6 = 0; num6 < peerSortFilters.Count; num6++)
                         {
                             if (eventSource.ID != peerSortFilters[num6])
                             {
                                 runtimeSortFilterEventInfo2.PeerSortFilters.Add(peerSortFilters[num6], null);
                             }
                         }
                     }
                 }
             }
         }
         return(true);
     }
     return(false);
 }
Exemplo n.º 14
0
        public object PublishClone(AutomaticSubtotalContext context, ReportHierarchyNode owner)
        {
            Grouping grouping = (Grouping)base.MemberwiseClone();

            grouping.m_isClone = true;
            grouping.m_ID      = context.GenerateID();
            grouping.m_owner   = owner;
            if (this.DomainScope != null)
            {
                grouping.DomainScope = context.GetNewScopeName(this.DomainScope);
                if (string.CompareOrdinal(this.DomainScope, grouping.DomainScope) != 0)
                {
                    context.DomainScopeGroups.Add(grouping);
                }
                else
                {
                    grouping.m_scopeIDForDomainScope = this.Owner.DataScopeInfo.ScopeID;
                }
            }
            context.AddAggregateHolder(grouping);
            Global.Tracer.Assert(this.m_name != null);
            grouping.m_name = context.CreateAndRegisterUniqueGroupName(this.m_name, this.m_isClone);
            context.AddSortTarget(grouping.m_name, grouping);
            this.CloneGroupExpressions(context, grouping);
            if (this.m_groupLabel != null)
            {
                grouping.m_groupLabel = (ExpressionInfo)this.m_groupLabel.PublishClone(context);
            }
            if (this.m_sortDirections != null)
            {
                grouping.m_sortDirections = new List <bool>(this.m_sortDirections.Count);
                foreach (bool sortDirection in this.m_sortDirections)
                {
                    grouping.m_sortDirections.Add(sortDirection);
                }
            }
            grouping.m_aggregates          = new List <DataAggregateInfo>();
            grouping.m_recursiveAggregates = new List <DataAggregateInfo>();
            grouping.m_postSortAggregates  = new List <DataAggregateInfo>();
            if (this.m_filters != null)
            {
                grouping.m_filters = new List <Filter>(this.m_filters.Count);
                foreach (Filter filter in this.m_filters)
                {
                    grouping.m_filters.Add((Filter)filter.PublishClone(context));
                }
            }
            if (this.m_parent != null)
            {
                grouping.m_parent = new List <ExpressionInfo>(this.m_parent.Count);
                foreach (ExpressionInfo item in this.m_parent)
                {
                    grouping.m_parent.Add((ExpressionInfo)item.PublishClone(context));
                }
            }
            if (this.m_dataElementName != null)
            {
                grouping.m_dataElementName = (string)this.m_dataElementName.Clone();
            }
            if (this.m_userSortExpressions != null)
            {
                grouping.m_userSortExpressions = new List <ExpressionInfo>(this.m_userSortExpressions.Count);
                foreach (ExpressionInfo userSortExpression in this.m_userSortExpressions)
                {
                    grouping.m_userSortExpressions.Add((ExpressionInfo)userSortExpression.PublishClone(context));
                }
            }
            if (this.m_variables != null)
            {
                grouping.m_variables = new List <Variable>(this.m_variables.Count);
                foreach (Variable variable in this.m_variables)
                {
                    grouping.m_variables.Add((Variable)variable.PublishClone(context));
                }
            }
            if (this.m_nonDetailSortFiltersInScope != null)
            {
                grouping.m_nonDetailSortFiltersInScope = new InScopeSortFilterHashtable(this.m_nonDetailSortFiltersInScope.Count);
                IDictionaryEnumerator enumerator6 = this.m_nonDetailSortFiltersInScope.GetEnumerator();
                try
                {
                    while (enumerator6.MoveNext())
                    {
                        object          current6        = enumerator6.Current;
                        DictionaryEntry dictionaryEntry = (DictionaryEntry)current6;
                        List <int>      list            = (List <int>)dictionaryEntry.Value;
                        List <int>      list2           = new List <int>(list.Count);
                        foreach (int item2 in list)
                        {
                            list2.Add(item2);
                        }
                        grouping.m_nonDetailSortFiltersInScope.Add(dictionaryEntry.Key, list2);
                    }
                }
                finally
                {
                    IDisposable disposable = enumerator6 as IDisposable;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                    }
                }
            }
            if (this.m_detailSortFiltersInScope != null)
            {
                grouping.m_detailSortFiltersInScope = new InScopeSortFilterHashtable(this.m_detailSortFiltersInScope.Count);
                IDictionaryEnumerator enumerator8 = this.m_detailSortFiltersInScope.GetEnumerator();
                try
                {
                    while (enumerator8.MoveNext())
                    {
                        object          current8         = enumerator8.Current;
                        DictionaryEntry dictionaryEntry2 = (DictionaryEntry)current8;
                        List <int>      list3            = (List <int>)dictionaryEntry2.Value;
                        List <int>      list4            = new List <int>(list3.Count);
                        foreach (int item3 in list3)
                        {
                            list4.Add(item3);
                        }
                        grouping.m_detailSortFiltersInScope.Add(dictionaryEntry2.Key, list4);
                    }
                }
                finally
                {
                    IDisposable disposable2 = enumerator8 as IDisposable;
                    if (disposable2 != null)
                    {
                        disposable2.Dispose();
                    }
                }
            }
            if (this.m_pageBreak != null)
            {
                grouping.m_pageBreak = (PageBreak)this.m_pageBreak.PublishClone(context);
            }
            if (this.m_pageName != null)
            {
                grouping.m_pageName = (ExpressionInfo)this.m_pageName.PublishClone(context);
            }
            return(grouping);
        }