public override void ReadRow(DataActions dataAction, ITraversalContext context)
 {
     if (DataActions.UserSort == dataAction)
     {
         RuntimeDataRegionObj.CommonFirstRow(base.m_odpContext, ref base.m_firstRowIsAggregate, ref base.m_firstRow);
         base.CommonNextRow(base.m_dataRows);
     }
     else if (DataActions.AggregatesOfAggregates == dataAction)
     {
         AggregateUpdateContext aggregateUpdateContext = (AggregateUpdateContext)context;
         aggregateUpdateContext.UpdateAggregatesForRow();
     }
     else
     {
         if (FlagUtils.HasFlag(dataAction, DataActions.PostSortAggregatesOfAggregates))
         {
             AggregateUpdateContext aggregateUpdateContext2 = (AggregateUpdateContext)context;
             aggregateUpdateContext2.UpdateAggregatesForRow();
         }
         if (!base.m_dataRegionDef.ProcessCellRunningValues)
         {
             if (FlagUtils.HasFlag(dataAction, DataActions.PostSortAggregates))
             {
                 if (base.m_postSortAggregates != null)
                 {
                     RuntimeDataRegionObj.UpdateAggregates(base.m_odpContext, base.m_postSortAggregates, false);
                 }
                 if (base.m_runningValues != null)
                 {
                     RuntimeDataTablixObj.UpdateRunningValues(base.m_odpContext, base.m_runningValues);
                 }
             }
             if (base.m_outerScope != null && (dataAction & base.m_outerDataAction) != 0)
             {
                 using (base.m_outerScope.PinValue())
                 {
                     IScope scope = base.m_outerScope.Value();
                     scope.ReadRow(dataAction, context);
                 }
             }
         }
     }
 }
Beispiel #2
0
 public override void ReadRow(DataActions dataAction, ITraversalContext context)
 {
     if (FlagUtils.HasFlag(dataAction, DataActions.PostSortAggregates) && FlagUtils.HasFlag(base.m_dataAction, DataActions.PostSortAggregates))
     {
         AggregatesImpl aggregatesImpl = base.m_odpContext.ReportObjectModel.AggregatesImpl;
         if (base.m_hierarchyDef.DataRegionDef.ProcessCellRunningValues)
         {
             if (this.m_cellRVs != null)
             {
                 for (int i = 0; i < this.m_cellRVs.Count; i++)
                 {
                     string text = this.m_cellRVs[i];
                     AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(text);
                     Global.Tracer.Assert(aggregateObj != null, "Missing expected running value: {0}", text);
                     aggregateObj.Update();
                 }
             }
             if (base.m_outerScope != null && base.m_hierarchyDef.DataRegionDef.CellPostSortAggregates != null)
             {
                 using (base.m_outerScope.PinValue())
                 {
                     base.m_outerScope.Value().ReadRow(dataAction, context);
                 }
             }
         }
         else
         {
             if (this.m_staticCellRVs != null)
             {
                 for (int j = 0; j < this.m_staticCellRVs.Count; j++)
                 {
                     string text2 = this.m_staticCellRVs[j];
                     AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj2 = aggregatesImpl.GetAggregateObj(text2);
                     Global.Tracer.Assert(aggregateObj2 != null, "Missing expected running value: {0}", text2);
                     aggregateObj2.Update();
                 }
             }
             base.ReadRow(dataAction, context);
         }
     }
 }
        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);
            }
        }
Beispiel #4
0
 public bool UpdateAggregates(DataScopeInfo scopeInfo, IDataRowHolder scopeInst, AggregateUpdateFlags updateFlags, bool needsSetupEnvironment)
 {
     this.m_aggsForUpdateAtRowScope     = null;
     this.m_runningValuesForUpdateAtRow = null;
     if (this.m_activeAggregates == null)
     {
         return(false);
     }
     for (AggregateUpdateCollection aggregateUpdateCollection = this.m_activeAggregates; aggregateUpdateCollection != null; aggregateUpdateCollection = aggregateUpdateCollection.LinkedCollection)
     {
         List <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj> list = default(List <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj>);
         if (aggregateUpdateCollection.GetAggregatesForScope(scopeInfo.ScopeID, out list))
         {
             if (needsSetupEnvironment)
             {
                 scopeInst.SetupEnvironment();
                 needsSetupEnvironment = false;
             }
             foreach (AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj item in list)
             {
                 item.Update();
             }
         }
         if (aggregateUpdateCollection.GetAggregatesForRowScope(scopeInfo.ScopeID, out list))
         {
             if (this.m_aggsForUpdateAtRowScope == null)
             {
                 this.m_aggsForUpdateAtRowScope = new List <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj>();
             }
             this.m_aggsForUpdateAtRowScope.AddRange(list);
         }
         List <string> list2 = default(List <string>);
         if (aggregateUpdateCollection.GetRunningValuesForScope(scopeInfo.ScopeID, out list2))
         {
             if (needsSetupEnvironment)
             {
                 scopeInst.SetupEnvironment();
                 needsSetupEnvironment = false;
             }
             RuntimeDataTablixObj.UpdateRunningValues(this.m_odpContext, list2);
         }
         if (aggregateUpdateCollection.GetRunningValuesForRowScope(scopeInfo.ScopeID, out list2))
         {
             if (this.m_runningValuesForUpdateAtRow == null)
             {
                 this.m_runningValuesForUpdateAtRow = new List <string>();
             }
             this.m_runningValuesForUpdateAtRow.AddRange(list2);
         }
     }
     if (this.m_aggsForUpdateAtRowScope != null || this.m_runningValuesForUpdateAtRow != null)
     {
         if (needsSetupEnvironment)
         {
             scopeInst.SetupEnvironment();
         }
         if (FlagUtils.HasFlag(updateFlags, AggregateUpdateFlags.RowAggregates))
         {
             scopeInst.ReadRows(DataActions.AggregatesOfAggregates, this);
         }
     }
     return(scopeInfo.ScopeID != this.m_activeAggregates.InnermostUpdateScopeID);
 }