public static void AddRunningValues(OnDemandProcessingContext odpContext, List <AspNetCore.ReportingServices.ReportIntermediateFormat.RunningValueInfo> runningValues, ref List <string> runningValuesInGroup, ref List <string> previousValuesInGroup, Dictionary <string, IReference <RuntimeGroupRootObj> > groupCollection, IReference <RuntimeGroupRootObj> lastGroup)
 {
     if (runningValues != null && 0 < runningValues.Count)
     {
         if (runningValuesInGroup == null)
         {
             runningValuesInGroup = new List <string>();
         }
         if (previousValuesInGroup == null)
         {
             previousValuesInGroup = new List <string>();
         }
         AggregatesImpl aggregatesImpl = odpContext.ReportObjectModel.AggregatesImpl;
         for (int i = 0; i < runningValues.Count; i++)
         {
             AspNetCore.ReportingServices.ReportIntermediateFormat.RunningValueInfo runningValueInfo = runningValues[i];
             AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = aggregatesImpl.GetAggregateObj(runningValueInfo.Name);
             if (dataAggregateObj == null)
             {
                 dataAggregateObj = new AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj(runningValueInfo, odpContext);
                 aggregatesImpl.Add(dataAggregateObj);
             }
             if (runningValueInfo.Scope != null)
             {
                 IReference <RuntimeGroupRootObj> reference = default(IReference <RuntimeGroupRootObj>);
                 if (groupCollection.TryGetValue(runningValueInfo.Scope, out reference))
                 {
                     using (reference.PinValue())
                     {
                         reference.Value().AddScopedRunningValue(dataAggregateObj);
                     }
                 }
                 else
                 {
                     Global.Tracer.Assert(false);
                 }
             }
             if (runningValueInfo.AggregateType == AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Previous)
             {
                 previousValuesInGroup.Add(dataAggregateObj.Name);
             }
             else
             {
                 runningValuesInGroup.Add(dataAggregateObj.Name);
             }
         }
     }
 }
        public static void UpdateRunningValues(OnDemandProcessingContext odpContext, List <string> runningValueNames)
        {
            AggregatesImpl aggregatesImpl = odpContext.ReportObjectModel.AggregatesImpl;

            for (int i = 0; i < runningValueNames.Count; i++)
            {
                string name = runningValueNames[i];
                AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(name);
                aggregateObj.Update();
            }
        }
Example #3
0
        internal void SetupCellRunningValues(Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] cellRunningValueValues)
        {
            if (cellRunningValueValues == null)
            {
                return;
            }
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;
            int            num            = (m_staticCellPreviousValues != null) ? m_staticCellPreviousValues.Count : 0;
            int            num2           = (m_staticCellRVs != null) ? m_staticCellRVs.Count : 0;

            if (num2 > 0)
            {
                for (int i = 0; i < num2; i++)
                {
                    string text = m_staticCellRVs[i];
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(text);
                    Global.Tracer.Assert(aggregateObj != null, "Missing expected running value: {0}", text);
                    aggregateObj.Set(cellRunningValueValues[i]);
                }
            }
            if (num > 0)
            {
                for (int j = 0; j < num; j++)
                {
                    string text2 = m_staticCellPreviousValues[j];
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj2 = aggregatesImpl.GetAggregateObj(text2);
                    Global.Tracer.Assert(aggregateObj2 != null, "Missing expected running value: {0}", text2);
                    aggregateObj2.Set(cellRunningValueValues[num2 + j]);
                }
            }
        }
 private void CreateAggregates(List <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateInfo> aggDefs)
 {
     if (aggDefs != null && 0 < aggDefs.Count)
     {
         AggregatesImpl aggregatesImpl = this.m_odpContext.ReportObjectModel.AggregatesImpl;
         for (int i = 0; i < aggDefs.Count; i++)
         {
             AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = aggDefs[i];
             AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj  dataAggregateObj  = aggregatesImpl.GetAggregateObj(dataAggregateInfo.Name);
             if (dataAggregateObj == null)
             {
                 dataAggregateObj = new AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, this.m_odpContext);
                 aggregatesImpl.Add(dataAggregateObj);
             }
             if (AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Previous != dataAggregateInfo.AggregateType)
             {
                 if (AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Aggregate == dataAggregateInfo.AggregateType)
                 {
                     RuntimeDataRegionObj.AddAggregate(ref this.m_customAggregates, dataAggregateObj);
                 }
                 else
                 {
                     RuntimeDataRegionObj.AddAggregate(ref this.m_nonCustomAggregates, dataAggregateObj);
                 }
             }
         }
     }
 }
Example #5
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);
        }
Example #6
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();
                }
            }
        }
Example #7
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();
        }
Example #8
0
 public override void ReadRow(DataActions dataAction, ITraversalContext context)
 {
     if (DataActions.PostSortAggregates == dataAction && m_runningValuesInGroup != null)
     {
         AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;
         for (int i = 0; i < m_runningValuesInGroup.Count; i++)
         {
             string text = m_runningValuesInGroup[i];
             Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(text);
             Global.Tracer.Assert(aggregateObj != null, "Missing expected running value aggregate: {0}", text);
             aggregateObj.Update();
         }
     }
     if (m_outerScope != null && (dataAction & m_outerDataAction) != 0)
     {
         using (m_outerScope.PinValue())
         {
             m_outerScope.Value().ReadRow(dataAction, context);
         }
     }
 }
Example #9
0
 internal override void CalculatePreviousAggregates()
 {
     if (m_previousValuesInGroup != null)
     {
         AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;
         for (int i = 0; i < m_previousValuesInGroup.Count; i++)
         {
             string text = m_previousValuesInGroup[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();
         }
     }
 }
Example #10
0
        private void AddRunningValue(Microsoft.ReportingServices.ReportIntermediateFormat.RunningValueInfo runningValue, List <string> runningValuesInGroup, List <string> previousValuesInGroup, Dictionary <string, IReference <RuntimeGroupRootObj> > groupCollection)
        {
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;
            bool           flag           = runningValue.AggregateType == Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Previous;
            List <string>  list           = (!flag) ? runningValuesInGroup : previousValuesInGroup;

            Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = aggregatesImpl.GetAggregateObj(runningValue.Name);
            if (dataAggregateObj == null)
            {
                dataAggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(runningValue, m_odpContext);
                aggregatesImpl.Add(dataAggregateObj);
            }
            else if (flag && (runningValue.Scope == null || runningValue.IsScopedInEvaluationScope))
            {
                dataAggregateObj.Init();
            }
            if (runningValue.Scope != null)
            {
                if (groupCollection.TryGetValue(runningValue.Scope, out IReference <RuntimeGroupRootObj> value))
                {
                    using (value.PinValue())
                    {
                        value.Value().AddScopedRunningValue(dataAggregateObj);
                    }
                }
                else
                {
                    Global.Tracer.Assert(condition: false, "RV with runtime scope escalation");
                }
            }
            if (!list.Contains(dataAggregateObj.Name))
            {
                list.Add(dataAggregateObj.Name);
            }
        }
Example #11
0
        private void CreateAggregates(List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo> aggDefs)
        {
            if (aggDefs == null || 0 >= aggDefs.Count)
            {
                return;
            }
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;

            for (int i = 0; i < aggDefs.Count; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = aggDefs[i];
                Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj  dataAggregateObj  = aggregatesImpl.GetAggregateObj(dataAggregateInfo.Name);
                if (dataAggregateObj == null)
                {
                    dataAggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, m_odpContext);
                    aggregatesImpl.Add(dataAggregateObj);
                }
                if (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Previous != dataAggregateInfo.AggregateType)
                {
                    if (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Aggregate == dataAggregateInfo.AggregateType)
                    {
                        RuntimeDataRegionObj.AddAggregate(ref m_customAggregates, dataAggregateObj);
                    }
                    else
                    {
                        RuntimeDataRegionObj.AddAggregate(ref m_nonCustomAggregates, dataAggregateObj);
                    }
                }
            }
        }