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);
                 }
             }
         }
     }
 }
Пример #2
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);
            }
        }
Пример #3
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);
                    }
                }
            }
        }
Пример #4
0
 private void PageInit()
 {
     m_processingContext.ReportObjectModel.GlobalsImpl.SetPageNumbers(m_currentPageNumber, m_totalPages);
     m_processingContext.ReportObjectModel.ReportItemsImpl = new ReportItemsImpl();
     m_processingContext.ReportObjectModel.AggregatesImpl  = new AggregatesImpl(m_processingContext.ReportRuntime);
     if (m_processingContext.ReportRuntime.ReportExprHost != null)
     {
         m_processingContext.RuntimeInitializeReportItemObjs(m_report.ReportItems, traverseDataRegions: true, setValue: true);
         if (m_report.PageHeader != null)
         {
             if (m_processingContext.ReportRuntime.ReportExprHost != null)
             {
                 m_report.PageHeader.SetExprHost(m_processingContext.ReportRuntime.ReportExprHost, m_processingContext.ReportObjectModel);
             }
             m_processingContext.RuntimeInitializeReportItemObjs(m_report.PageHeader.ReportItems, traverseDataRegions: false, setValue: false);
         }
         if (m_report.PageFooter != null)
         {
             if (m_processingContext.ReportRuntime.ReportExprHost != null)
             {
                 m_report.PageFooter.SetExprHost(m_processingContext.ReportRuntime.ReportExprHost, m_processingContext.ReportObjectModel);
             }
             m_processingContext.RuntimeInitializeReportItemObjs(m_report.PageFooter.ReportItems, traverseDataRegions: false, setValue: false);
         }
     }
     m_aggregates = new AggregatesImpl(m_processingContext.ReportRuntime);
     m_aggregatesOverReportItems = new Hashtable();
     m_processingContext.ReportObjectModel.ReportItemsImpl.SpecialMode = true;
     if (m_report.PageAggregates != null)
     {
         for (int i = 0; i < m_report.PageAggregates.Count; i++)
         {
             DataAggregateInfo dataAggregateInfo = m_report.PageAggregates[i];
             dataAggregateInfo.ExprHostInitialized = false;
             DataAggregateObj dataAggregateObj = new DataAggregateObj(dataAggregateInfo, m_processingContext);
             dataAggregateObj.EvaluateParameters(out object[] _, out DataFieldStatus _);
             string specialModeIndex = m_processingContext.ReportObjectModel.ReportItemsImpl.GetSpecialModeIndex();
             if (specialModeIndex == null)
             {
                 m_aggregates.Add(dataAggregateObj);
             }
             else
             {
                 AggregatesImpl aggregatesImpl = (AggregatesImpl)m_aggregatesOverReportItems[specialModeIndex];
                 if (aggregatesImpl == null)
                 {
                     aggregatesImpl = new AggregatesImpl(m_processingContext.ReportRuntime);
                     m_aggregatesOverReportItems.Add(specialModeIndex, aggregatesImpl);
                 }
                 aggregatesImpl.Add(dataAggregateObj);
             }
             dataAggregateObj.Init();
         }
     }
     m_processingContext.ReportObjectModel.ReportItemsImpl.SpecialMode = false;
 }
        internal static void AddRunningValues(OnDemandProcessingContext odpContext, List <Microsoft.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)
            {
                return;
            }
            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++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.RunningValueInfo runningValueInfo = runningValues[i];
                Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = aggregatesImpl.GetAggregateObj(runningValueInfo.Name);
                if (dataAggregateObj == null)
                {
                    dataAggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(runningValueInfo, odpContext);
                    aggregatesImpl.Add(dataAggregateObj);
                }
                if (runningValueInfo.Scope != null)
                {
                    if (groupCollection.TryGetValue(runningValueInfo.Scope, out IReference <RuntimeGroupRootObj> value))
                    {
                        using (value.PinValue())
                        {
                            value.Value().AddScopedRunningValue(dataAggregateObj);
                        }
                    }
                    else
                    {
                        Global.Tracer.Assert(condition: false);
                    }
                }
                if (runningValueInfo.AggregateType == Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Previous)
                {
                    previousValuesInGroup.Add(dataAggregateObj.Name);
                }
                else
                {
                    runningValuesInGroup.Add(dataAggregateObj.Name);
                }
            }
        }
 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);
             }
         }
     }
 }
        private void PageInit(ReportSection section)
        {
            ObjectModelImpl reportObjectModel = m_processingContext.ReportObjectModel;
            AggregatesImpl  aggregatesImpl    = reportObjectModel.AggregatesImpl;

            Global.Tracer.Assert(section.BodyItemsForHeadFoot != null, "Missing cached BodyItemsForHeadFoot collection");
            Global.Tracer.Assert(section.PageSectionItemsForHeadFoot != null, "Missing cached PageSectionItemsForHeadFoot collection");
            section.BodyItemsForHeadFoot.ResetAll(default(Microsoft.ReportingServices.RdlExpressions.VariantResult));
            section.PageSectionItemsForHeadFoot.ResetAll();
            reportObjectModel.GlobalsImpl.SetPageNumbers(m_currentPageNumber, m_totalPages, m_currentOverallPageNumber, m_overallTotalPages);
            reportObjectModel.GlobalsImpl.SetPageName(m_pageName);
            _ = m_romReport.ReportDef;
            Microsoft.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef = section.SectionDef;
            Microsoft.ReportingServices.ReportIntermediateFormat.Page          page       = sectionDef.Page;
            section.PageAggregatesOverReportItems = new Dictionary <string, AggregatesImpl>();
            m_processingContext.ReportObjectModel.ReportItemsImpl.SpecialMode = true;
            if (page.PageAggregates != null)
            {
                for (int i = 0; i < page.PageAggregates.Count; i++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = page.PageAggregates[i];
                    aggregatesImpl.Remove(dataAggregateInfo);
                    dataAggregateInfo.ExprHostInitialized = false;
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, m_processingContext);
                    dataAggregateObj.EvaluateParameters(out object[] _, out DataFieldStatus _);
                    string specialModeIndex = reportObjectModel.ReportItemsImpl.GetSpecialModeIndex();
                    if (specialModeIndex == null)
                    {
                        aggregatesImpl.Add(dataAggregateObj);
                    }
                    else
                    {
                        if (!section.PageAggregatesOverReportItems.TryGetValue(specialModeIndex, out AggregatesImpl value))
                        {
                            value = new AggregatesImpl(m_processingContext);
                            section.PageAggregatesOverReportItems.Add(specialModeIndex, value);
                        }
                        value.Add(dataAggregateObj);
                        m_reportItemToReportSection[specialModeIndex] = section;
                    }
                    dataAggregateObj.Init();
                }
            }
            reportObjectModel.ReportItemsImpl.SpecialMode = false;
            Microsoft.ReportingServices.ReportIntermediateFormat.PageSection rifObject = null;
            IReportScopeInstance romInstance = null;

            if (sectionDef.Page.PageHeader != null)
            {
                rifObject   = sectionDef.Page.PageHeader;
                romInstance = section.Page.PageHeader.Instance.ReportScopeInstance;
                section.Page.PageHeader.SetNewContext();
            }
            if (sectionDef.Page.PageFooter != null)
            {
                rifObject   = sectionDef.Page.PageFooter;
                romInstance = section.Page.PageFooter.Instance.ReportScopeInstance;
                section.Page.PageFooter.SetNewContext();
            }
            if (sectionDef != null)
            {
                m_processingContext.SetupContext(rifObject, romInstance);
            }
        }