Exemple #1
0
        internal void DoneReadingRows(ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] runningValueValues, ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] runningValueOfAggregateValues, ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] cellRunningValueValues)
        {
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;

            RuntimeRICollection.StoreRunningValues(aggregatesImpl, m_hierarchyDef.RunningValues, ref runningValueValues);
            if (m_hierarchyDef.DataScopeInfo != null)
            {
                RuntimeRICollection.StoreRunningValues(aggregatesImpl, m_hierarchyDef.DataScopeInfo.RunningValuesOfAggregates, ref runningValueOfAggregateValues);
            }
            int num  = (m_staticCellPreviousValues != null) ? m_staticCellPreviousValues.Count : 0;
            int num2 = (m_staticCellRVs != null) ? m_staticCellRVs.Count : 0;

            if (num2 > 0)
            {
                cellRunningValueValues = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[num2 + num];
                for (int i = 0; i < num2; i++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(m_staticCellRVs[i]);
                    cellRunningValueValues[i] = aggregateObj.AggregateResult();
                }
            }
            if (num > 0)
            {
                if (cellRunningValueValues == null)
                {
                    cellRunningValueValues = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[num];
                }
                for (int j = 0; j < num; j++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj2 = aggregatesImpl.GetAggregateObj(m_staticCellPreviousValues[j]);
                    cellRunningValueValues[num2 + j] = aggregateObj2.AggregateResult();
                }
            }
        }
        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);
            }
        }