Esempio n. 1
0
 public void RestoreOriginalState(AggregateUpdateQueue queue)
 {
     if (queue != null)
     {
         this.m_activeAggregates = queue.OriginalState;
     }
 }
Esempio n. 2
0
        private AggregateUpdateQueue HandleNewBuckets(BucketedDataAggregateObjs aggBuckets, bool canMergeActiveAggs)
        {
            bool flag = aggBuckets == null || aggBuckets.Buckets.Count == 0;

            if (canMergeActiveAggs && flag)
            {
                return(null);
            }
            AggregateUpdateQueue      aggregateUpdateQueue      = new AggregateUpdateQueue(this.m_activeAggregates);
            AggregateUpdateCollection aggregateUpdateCollection = null;

            if (canMergeActiveAggs)
            {
                aggregateUpdateCollection = this.m_activeAggregates;
            }
            this.m_activeAggregates = null;
            if (flag)
            {
                return(aggregateUpdateQueue);
            }
            for (int i = 0; i < aggBuckets.Buckets.Count; i++)
            {
                AggregateBucket <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj> aggregateBucket = aggBuckets.Buckets[i];
                AggregateUpdateCollection aggregateUpdateCollection2 = new AggregateUpdateCollection(aggregateBucket);
                if (aggregateUpdateCollection != null)
                {
                    if (aggregateUpdateCollection.Level == aggregateBucket.Level)
                    {
                        aggregateUpdateCollection2.LinkedCollection = aggregateUpdateCollection;
                        aggregateUpdateCollection = null;
                    }
                    else if (aggregateUpdateCollection.Level < aggregateBucket.Level)
                    {
                        aggregateUpdateCollection2 = aggregateUpdateCollection;
                        i--;
                        aggregateUpdateCollection = null;
                    }
                }
                if (this.m_activeAggregates == null)
                {
                    this.m_activeAggregates = aggregateUpdateCollection2;
                }
                else
                {
                    aggregateUpdateQueue.Enqueue(aggregateUpdateCollection2);
                }
            }
            if (aggregateUpdateCollection != null)
            {
                aggregateUpdateQueue.Enqueue(aggregateUpdateCollection);
            }
            return(aggregateUpdateQueue);
        }
Esempio n. 3
0
 public bool AdvanceQueue(AggregateUpdateQueue queue)
 {
     if (queue == null)
     {
         return(false);
     }
     if (queue.Count == 0)
     {
         this.RestoreOriginalState(queue);
         return(false);
     }
     this.m_activeAggregates = queue.Dequeue();
     return(true);
 }
        public override bool SortAndFilter(AggregateUpdateContext aggContext)
        {
            this.SetupEnvironment();
            if (base.m_userSortTargetInfo != null)
            {
                base.m_userSortTargetInfo.EnterProcessUserSortPhase(base.m_odpContext);
            }
            bool flag = base.DataRegionDef.ProcessingInnerGrouping == AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion.ProcessingInnerGroupings.Column;

            IReference <RuntimeMemberObj>[] array  = flag ? this.m_outerGroupings : this.m_innerGroupings;
            IReference <RuntimeMemberObj>[] array2 = flag ? this.m_innerGroupings : this.m_outerGroupings;
            int rowDomainScopeCount    = base.DataRegionDef.RowDomainScopeCount;
            int columnDomainScopeCount = base.DataRegionDef.ColumnDomainScopeCount;
            DomainScopeContext   domainScopeContext = base.OdpContext.DomainScopeContext;
            AggregateUpdateQueue workQueue          = null;

            if (base.m_odpContext.HasSecondPassOperation(SecondPassOperations.FilteringOrAggregatesOrDomainScope))
            {
                workQueue = RuntimeDataRegionObj.AggregateOfAggregatesStart(aggContext, this, base.m_dataRegionDef.DataScopeInfo, base.m_aggregatesOfAggregates, AggregateUpdateFlags.Both, false);
                if (rowDomainScopeCount > 0)
                {
                    domainScopeContext.AddDomainScopes(array, array.Length - rowDomainScopeCount);
                }
                if (columnDomainScopeCount > 0)
                {
                    domainScopeContext.AddDomainScopes(array2, array2.Length - columnDomainScopeCount);
                }
            }
            this.Traverse(ProcessingStages.SortAndFilter, aggContext);
            base.SortAndFilter(aggContext);
            if (base.m_odpContext.HasSecondPassOperation(SecondPassOperations.FilteringOrAggregatesOrDomainScope))
            {
                RuntimeDataRegionObj.AggregatesOfAggregatesEnd(this, aggContext, workQueue, base.m_dataRegionDef.DataScopeInfo, base.m_aggregatesOfAggregates, true);
                if (rowDomainScopeCount > 0)
                {
                    domainScopeContext.RemoveDomainScopes(array, array.Length - rowDomainScopeCount);
                }
                if (columnDomainScopeCount > 0)
                {
                    domainScopeContext.RemoveDomainScopes(array2, array2.Length - columnDomainScopeCount);
                }
            }
            if (base.m_userSortTargetInfo != null)
            {
                base.m_userSortTargetInfo.LeaveProcessUserSortPhase(base.m_odpContext);
            }
            return(true);
        }
Esempio n. 5
0
 public AggregateUpdateQueue RegisterRunningValuesToUpdate(AggregateUpdateQueue workQueue, List <AspNetCore.ReportingServices.ReportIntermediateFormat.RunningValueInfo> runningValues)
 {
     if (runningValues != null && runningValues.Count != 0)
     {
         if (workQueue == null)
         {
             workQueue = new AggregateUpdateQueue(this.m_activeAggregates);
             AggregateUpdateCollection aggregateUpdateCollection = new AggregateUpdateCollection(runningValues);
             aggregateUpdateCollection.LinkedCollection = this.m_activeAggregates;
             this.m_activeAggregates = aggregateUpdateCollection;
         }
         else
         {
             this.m_activeAggregates.MergeRunningValues(runningValues);
         }
         return(workQueue);
     }
     return(workQueue);
 }
        public static AggregateUpdateQueue AggregateOfAggregatesStart(AggregateUpdateContext aggContext, IDataRowHolder scope, DataScopeInfo dataScopeInfo, BucketedDataAggregateObjs aggregatesOfAggregates, AggregateUpdateFlags updateFlags, bool needsSetupEnvironment)
        {
            if (dataScopeInfo == null)
            {
                return(null);
            }
            AggregateUpdateQueue result = null;

            if (aggContext.Mode == AggregateMode.Aggregates)
            {
                if (dataScopeInfo.NeedsSeparateAofAPass)
                {
                    result = aggContext.ReplaceAggregatesToUpdate(aggregatesOfAggregates);
                }
                else
                {
                    result = aggContext.RegisterAggregatesToUpdate(aggregatesOfAggregates);
                    if (updateFlags != 0)
                    {
                        RuntimeDataRegionObj.UpdateAggregatesAtScope(aggContext, scope, dataScopeInfo, updateFlags, needsSetupEnvironment);
                    }
                }
            }
            else if (aggContext.Mode == AggregateMode.PostSortAggregates)
            {
                result = aggContext.RegisterAggregatesToUpdate(aggregatesOfAggregates);
                result = aggContext.RegisterRunningValuesToUpdate(result, dataScopeInfo.RunningValuesOfAggregates);
                if (updateFlags != 0)
                {
                    RuntimeDataRegionObj.UpdateAggregatesAtScope(aggContext, scope, dataScopeInfo, updateFlags, needsSetupEnvironment);
                }
            }
            else
            {
                Global.Tracer.Assert(false, "Unknown AggregateMode for AggregateOfAggregatesStart");
            }
            return(result);
        }
 public static void AggregatesOfAggregatesEnd(IScope scopeObj, AggregateUpdateContext aggContext, AggregateUpdateQueue workQueue, DataScopeInfo dataScopeInfo, BucketedDataAggregateObjs aggregatesOfAggregates, bool updateAggsIfNeeded)
 {
     if (dataScopeInfo != null)
     {
         if (updateAggsIfNeeded)
         {
             while (aggContext.AdvanceQueue(workQueue))
             {
                 scopeObj.UpdateAggregates(aggContext);
             }
         }
         aggContext.RestoreOriginalState(workQueue);
         if (aggContext.Mode == AggregateMode.Aggregates && dataScopeInfo.NeedsSeparateAofAPass && updateAggsIfNeeded)
         {
             scopeObj.UpdateAggregates(aggContext);
         }
     }
 }
        public override void CalculateRunningValues(Dictionary <string, IReference <RuntimeGroupRootObj> > groupCol, IReference <RuntimeGroupRootObj> lastGroup, AggregateUpdateContext aggContext)
        {
            if (base.m_dataRegionDef.RunningValues != null && base.m_runningValues == null && base.m_previousValues == null)
            {
                RuntimeDataTablixObj.AddRunningValues(base.m_odpContext, base.m_dataRegionDef.RunningValues, ref base.m_runningValues, ref base.m_previousValues, groupCol, lastGroup);
            }
            if (base.m_dataRegionDef.DataScopeInfo != null)
            {
                List <string> list  = null;
                List <string> list2 = null;
                RuntimeDataTablixObj.AddRunningValues(base.m_odpContext, base.m_dataRegionDef.DataScopeInfo.RunningValuesOfAggregates, ref list, ref list2, groupCol, lastGroup);
            }
            bool flag = base.m_dataRows != null && FlagUtils.HasFlag(base.m_dataAction, DataActions.PostSortAggregates);
            AggregateUpdateQueue workQueue = RuntimeDataRegionObj.AggregateOfAggregatesStart(aggContext, this, base.m_dataRegionDef.DataScopeInfo, base.m_postSortAggregatesOfAggregates, (AggregateUpdateFlags)(flag ? 1 : 3), true);

            if (flag)
            {
                DataActions dataActions = DataActions.PostSortAggregates;
                if (aggContext.LastScopeNeedsRowAggregateProcessing())
                {
                    dataActions |= DataActions.PostSortAggregatesOfAggregates;
                }
                base.ReadRows(dataActions, aggContext);
                base.m_dataRows = null;
            }
            int num = (this.m_outerGroupings != null) ? this.m_outerGroupings.Length : 0;

            if (num == 0)
            {
                if (this.m_innerGroupings != null)
                {
                    for (int i = 0; i < this.m_innerGroupings.Length; i++)
                    {
                        IReference <RuntimeMemberObj> reference = this.m_innerGroupings[i];
                        using (reference.PinValue())
                        {
                            reference.Value().CalculateRunningValues(groupCol, lastGroup, aggContext);
                        }
                    }
                }
            }
            else
            {
                for (int j = 0; j < num; j++)
                {
                    IReference <RuntimeMemberObj> reference2 = this.m_outerGroupings[j];
                    bool flag2 = default(bool);
                    using (reference2.PinValue())
                    {
                        RuntimeMemberObj runtimeMemberObj = reference2.Value();
                        runtimeMemberObj.CalculateRunningValues(groupCol, lastGroup, aggContext);
                        flag2 = ((BaseReference)runtimeMemberObj.GroupRoot == (object)null);
                    }
                    if (flag2 && this.m_innerGroupings != null)
                    {
                        for (int k = 0; k < this.m_innerGroupings.Length; k++)
                        {
                            IReference <RuntimeMemberObj> reference3 = this.m_innerGroupings[k];
                            using (reference3.PinValue())
                            {
                                RuntimeMemberObj runtimeMemberObj2 = reference3.Value();
                                runtimeMemberObj2.PrepareCalculateRunningValues();
                                runtimeMemberObj2.CalculateRunningValues(groupCol, lastGroup, aggContext);
                            }
                        }
                    }
                }
            }
            this.CalculateRunningValuesForTopLevelStaticContents(groupCol, lastGroup, aggContext);
            RuntimeDataRegionObj.AggregatesOfAggregatesEnd(this, aggContext, workQueue, base.m_dataRegionDef.DataScopeInfo, base.m_postSortAggregatesOfAggregates, true);
            this.CalculateDRPreviousAggregates();
            RuntimeRICollection.StoreRunningValues(base.m_odpContext.ReportObjectModel.AggregatesImpl, base.m_dataRegionDef.RunningValues, ref base.m_runningValueValues);
            if (base.m_dataRegionDef.DataScopeInfo != null)
            {
                RuntimeRICollection.StoreRunningValues(base.m_odpContext.ReportObjectModel.AggregatesImpl, base.m_dataRegionDef.DataScopeInfo.RunningValuesOfAggregates, ref base.m_runningValueOfAggregateValues);
            }
        }