Пример #1
0
        public override void ReadRow(DataActions dataAction, ITraversalContext context)
        {
            if (!FlagUtils.HasFlag(dataAction, DataActions.PostSortAggregates) || !FlagUtils.HasFlag(m_dataAction, DataActions.PostSortAggregates))
            {
                return;
            }
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;

            if (m_hierarchyDef.DataRegionDef.ProcessCellRunningValues)
            {
                if (m_cellRVs != null)
                {
                    for (int i = 0; i < m_cellRVs.Count; i++)
                    {
                        string text = m_cellRVs[i];
                        Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(text);
                        Global.Tracer.Assert(aggregateObj != null, "Missing expected running value: {0}", text);
                        aggregateObj.Update();
                    }
                }
                if (m_outerScope != null && m_hierarchyDef.DataRegionDef.CellPostSortAggregates != null)
                {
                    using (m_outerScope.PinValue())
                    {
                        m_outerScope.Value().ReadRow(dataAction, context);
                    }
                }
                return;
            }
            if (m_staticCellRVs != null)
            {
                for (int j = 0; j < m_staticCellRVs.Count; j++)
                {
                    string text2 = m_staticCellRVs[j];
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj2 = aggregatesImpl.GetAggregateObj(text2);
                    Global.Tracer.Assert(aggregateObj2 != null, "Missing expected running value: {0}", text2);
                    aggregateObj2.Update();
                }
            }
            base.ReadRow(dataAction, context);
        }
Пример #2
0
        internal override void CalculatePreviousAggregates()
        {
            if (!FlagUtils.HasFlag(m_dataAction, DataActions.PostSortAggregates))
            {
                return;
            }
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;

            if (m_hierarchyDef.DataRegionDef.ProcessCellRunningValues)
            {
                if (m_cellPreviousValues != null)
                {
                    for (int i = 0; i < m_cellPreviousValues.Count; i++)
                    {
                        string text = m_cellPreviousValues[i];
                        Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(text);
                        Global.Tracer.Assert(aggregateObj != null, "Missing expected previous aggregate: {0}", text);
                        aggregateObj.Update();
                    }
                }
                if (m_outerScope != null && (m_outerDataAction & DataActions.PostSortAggregates) != 0)
                {
                    using (m_outerScope.PinValue())
                    {
                        m_outerScope.Value().CalculatePreviousAggregates();
                    }
                }
                return;
            }
            if (m_staticCellPreviousValues != null)
            {
                for (int j = 0; j < m_staticCellPreviousValues.Count; j++)
                {
                    string text2 = m_staticCellPreviousValues[j];
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj2 = aggregatesImpl.GetAggregateObj(text2);
                    Global.Tracer.Assert(aggregateObj2 != null, "Missing expected previous aggregate: {0}", text2);
                    aggregateObj2.Update();
                }
            }
            base.CalculatePreviousAggregates();
        }
 public override void ReadRow(DataActions dataAction, ITraversalContext context)
 {
     if (DataActions.UserSort == dataAction)
     {
         RuntimeDataRegionObj.CommonFirstRow(m_odpContext, ref m_firstRowIsAggregate, ref m_firstRow);
         CommonNextRow(m_dataRows);
         return;
     }
     if (DataActions.AggregatesOfAggregates == dataAction)
     {
         ((AggregateUpdateContext)context).UpdateAggregatesForRow();
         return;
     }
     if (FlagUtils.HasFlag(dataAction, DataActions.PostSortAggregatesOfAggregates))
     {
         ((AggregateUpdateContext)context).UpdateAggregatesForRow();
     }
     if (m_dataRegionDef.ProcessCellRunningValues)
     {
         return;
     }
     if (FlagUtils.HasFlag(dataAction, DataActions.PostSortAggregates))
     {
         if (m_postSortAggregates != null)
         {
             RuntimeDataRegionObj.UpdateAggregates(m_odpContext, m_postSortAggregates, updateAndSetup: false);
         }
         if (m_runningValues != null)
         {
             UpdateRunningValues(m_odpContext, m_runningValues);
         }
     }
     if (m_outerScope != null && (dataAction & m_outerDataAction) != 0)
     {
         using (m_outerScope.PinValue())
         {
             m_outerScope.Value().ReadRow(dataAction, context);
         }
     }
 }
        internal override void CalculateRunningValues(Dictionary <string, IReference <RuntimeGroupRootObj> > groupCol, IReference <RuntimeGroupRootObj> lastGroup, AggregateUpdateContext aggContext)
        {
            if (m_dataRegionDef.RunningValues != null && m_runningValues == null && m_previousValues == null)
            {
                AddRunningValues(m_odpContext, m_dataRegionDef.RunningValues, ref m_runningValues, ref m_previousValues, groupCol, lastGroup);
            }
            if (m_dataRegionDef.DataScopeInfo != null)
            {
                List <string> runningValuesInGroup  = null;
                List <string> previousValuesInGroup = null;
                AddRunningValues(m_odpContext, m_dataRegionDef.DataScopeInfo.RunningValuesOfAggregates, ref runningValuesInGroup, ref previousValuesInGroup, groupCol, lastGroup);
            }
            bool flag = m_dataRows != null && FlagUtils.HasFlag(m_dataAction, DataActions.PostSortAggregates);
            AggregateUpdateQueue workQueue = RuntimeDataRegionObj.AggregateOfAggregatesStart(aggContext, this, m_dataRegionDef.DataScopeInfo, m_postSortAggregatesOfAggregates, flag ? AggregateUpdateFlags.ScopedAggregates : AggregateUpdateFlags.Both, needsSetupEnvironment: true);

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

            if (num == 0)
            {
                if (m_innerGroupings != null)
                {
                    for (int i = 0; i < m_innerGroupings.Length; i++)
                    {
                        IReference <RuntimeMemberObj> reference = m_innerGroupings[i];
                        using (reference.PinValue())
                        {
                            reference.Value().CalculateRunningValues(groupCol, lastGroup, aggContext);
                        }
                    }
                }
            }
            else
            {
                for (int j = 0; j < num; j++)
                {
                    IReference <RuntimeMemberObj> reference2 = m_outerGroupings[j];
                    bool flag2;
                    using (reference2.PinValue())
                    {
                        RuntimeMemberObj runtimeMemberObj = reference2.Value();
                        runtimeMemberObj.CalculateRunningValues(groupCol, lastGroup, aggContext);
                        flag2 = (runtimeMemberObj.GroupRoot == null);
                    }
                    if (!flag2 || m_innerGroupings == null)
                    {
                        continue;
                    }
                    for (int k = 0; k < m_innerGroupings.Length; k++)
                    {
                        IReference <RuntimeMemberObj> reference3 = m_innerGroupings[k];
                        using (reference3.PinValue())
                        {
                            RuntimeMemberObj runtimeMemberObj2 = reference3.Value();
                            runtimeMemberObj2.PrepareCalculateRunningValues();
                            runtimeMemberObj2.CalculateRunningValues(groupCol, lastGroup, aggContext);
                        }
                    }
                }
            }
            CalculateRunningValuesForTopLevelStaticContents(groupCol, lastGroup, aggContext);
            RuntimeDataRegionObj.AggregatesOfAggregatesEnd(this, aggContext, workQueue, m_dataRegionDef.DataScopeInfo, m_postSortAggregatesOfAggregates, updateAggsIfNeeded: true);
            CalculateDRPreviousAggregates();
            RuntimeRICollection.StoreRunningValues(m_odpContext.ReportObjectModel.AggregatesImpl, m_dataRegionDef.RunningValues, ref m_runningValueValues);
            if (m_dataRegionDef.DataScopeInfo != null)
            {
                RuntimeRICollection.StoreRunningValues(m_odpContext.ReportObjectModel.AggregatesImpl, m_dataRegionDef.DataScopeInfo.RunningValuesOfAggregates, ref m_runningValueOfAggregateValues);
            }
        }
 public bool UpdateAggregates(DataScopeInfo scopeInfo, IDataRowHolder scopeInst, AggregateUpdateFlags updateFlags, bool needsSetupEnvironment)
 {
     m_aggsForUpdateAtRowScope     = null;
     m_runningValuesForUpdateAtRow = null;
     if (m_activeAggregates == null)
     {
         return(false);
     }
     for (AggregateUpdateCollection aggregateUpdateCollection = m_activeAggregates; aggregateUpdateCollection != null; aggregateUpdateCollection = aggregateUpdateCollection.LinkedCollection)
     {
         if (aggregateUpdateCollection.GetAggregatesForScope(scopeInfo.ScopeID, out List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj> aggs))
         {
             if (needsSetupEnvironment)
             {
                 scopeInst.SetupEnvironment();
                 needsSetupEnvironment = false;
             }
             foreach (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj item in aggs)
             {
                 item.Update();
             }
         }
         if (aggregateUpdateCollection.GetAggregatesForRowScope(scopeInfo.ScopeID, out aggs))
         {
             if (m_aggsForUpdateAtRowScope == null)
             {
                 m_aggsForUpdateAtRowScope = new List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj>();
             }
             m_aggsForUpdateAtRowScope.AddRange(aggs);
         }
         if (aggregateUpdateCollection.GetRunningValuesForScope(scopeInfo.ScopeID, out List <string> aggs2))
         {
             if (needsSetupEnvironment)
             {
                 scopeInst.SetupEnvironment();
                 needsSetupEnvironment = false;
             }
             RuntimeDataTablixObj.UpdateRunningValues(m_odpContext, aggs2);
         }
         if (aggregateUpdateCollection.GetRunningValuesForRowScope(scopeInfo.ScopeID, out aggs2))
         {
             if (m_runningValuesForUpdateAtRow == null)
             {
                 m_runningValuesForUpdateAtRow = new List <string>();
             }
             m_runningValuesForUpdateAtRow.AddRange(aggs2);
         }
     }
     if (m_aggsForUpdateAtRowScope != null || m_runningValuesForUpdateAtRow != null)
     {
         if (needsSetupEnvironment)
         {
             scopeInst.SetupEnvironment();
         }
         if (FlagUtils.HasFlag(updateFlags, AggregateUpdateFlags.RowAggregates))
         {
             scopeInst.ReadRows(DataActions.AggregatesOfAggregates, this);
         }
     }
     return(scopeInfo.ScopeID != m_activeAggregates.InnermostUpdateScopeID);
 }