private void InitializeEnvironment()
		{
			this.m_processingContext = base.m_romReport.HeaderFooterRenderingContext.OdpContext;
			AspNetCore.ReportingServices.ReportIntermediateFormat.Report reportDef = base.m_romReport.ReportDef;
			AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ObjectModelImpl reportObjectModel = this.m_processingContext.ReportObjectModel;
			if (reportDef.DataSetsNotOnlyUsedInParameters == 1)
			{
				this.m_processingContext.SetupFieldsForNewDataSetPageSection(reportDef.FirstDataSet);
			}
			else
			{
				this.m_processingContext.SetupEmptyTopLevelFields();
			}
			reportObjectModel.VariablesImpl = new VariablesImpl(false);
			if (reportDef.HasVariables)
			{
				AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance currentReportInstance = base.m_romReport.RenderingContext.OdpContext.CurrentReportInstance;
				this.m_processingContext.RuntimeInitializePageSectionVariables(reportDef, (currentReportInstance != null) ? currentReportInstance.VariableValues : null);
			}
			reportObjectModel.LookupsImpl = new LookupsImpl();
			if (reportDef.HasLookups)
			{
				this.m_processingContext.RuntimeInitializeLookups(reportDef);
			}
			AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ReportItemsImpl reportItemsImpl = new AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ReportItemsImpl(false);
			foreach (ReportSection reportSection in base.m_romReport.ReportSections)
			{
				AspNetCore.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef = reportSection.SectionDef;
				reportSection.BodyItemsForHeadFoot = new AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ReportItemsImpl(false);
				reportSection.PageSectionItemsForHeadFoot = new AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ReportItemsImpl(false);
				reportObjectModel.ReportItemsImpl = reportSection.BodyItemsForHeadFoot;
				this.m_processingContext.RuntimeInitializeTextboxObjs(sectionDef.ReportItems, false);
				reportObjectModel.ReportItemsImpl = reportSection.PageSectionItemsForHeadFoot;
				AspNetCore.ReportingServices.ReportIntermediateFormat.Page page = sectionDef.Page;
				if (page.PageHeader != null)
				{
					if (this.m_processingContext.ReportRuntime.ReportExprHost != null)
					{
						page.PageHeader.SetExprHost(this.m_processingContext.ReportRuntime.ReportExprHost, reportObjectModel);
					}
					this.m_processingContext.RuntimeInitializeReportItemObjs(page.PageHeader.ReportItems, false);
					this.m_processingContext.RuntimeInitializeTextboxObjs(page.PageHeader.ReportItems, true);
				}
				if (page.PageFooter != null)
				{
					if (this.m_processingContext.ReportRuntime.ReportExprHost != null)
					{
						page.PageFooter.SetExprHost(this.m_processingContext.ReportRuntime.ReportExprHost, reportObjectModel);
					}
					this.m_processingContext.RuntimeInitializeReportItemObjs(page.PageFooter.ReportItems, false);
					this.m_processingContext.RuntimeInitializeTextboxObjs(page.PageFooter.ReportItems, true);
				}
				reportItemsImpl.AddAll(reportSection.BodyItemsForHeadFoot);
				reportItemsImpl.AddAll(reportSection.PageSectionItemsForHeadFoot);
			}
			reportObjectModel.ReportItemsImpl = reportItemsImpl;
			reportObjectModel.AggregatesImpl = new AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.AggregatesImpl(this.m_processingContext);
		}
		public override void UpdatePageSections(ReportSection section)
		{
			if (section.Page.PageHeader == null && section.Page.PageFooter == null)
			{
				return;
			}
			AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ObjectModelImpl reportObjectModel = this.m_processingContext.ReportObjectModel;
			reportObjectModel.GlobalsImpl.SetPageName(base.m_pageName);
			if (section.PageAggregatesOverReportItems == null)
			{
				throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidPageSectionState, section.SectionIndex);
			}
			foreach (AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.AggregatesImpl value in section.PageAggregatesOverReportItems.Values)
			{
				foreach (AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj @object in value.Objects)
				{
					reportObjectModel.AggregatesImpl.Add(@object);
				}
			}
			section.PageAggregatesOverReportItems = null;
		}
 public AspNetCore.ReportingServices.RdlExpressions.VariantResult GetResult(IReportScopeInstance romInstance, bool calledFromValue)
 {
     if (calledFromValue && !this.IsTextboxInScope())
     {
         this.m_result = default(AspNetCore.ReportingServices.RdlExpressions.VariantResult);
     }
     else if (!this.m_isValueReady)
     {
         if (this.m_isVisited)
         {
             base.m_iErrorContext.Register(ProcessingErrorCode.rsCyclicExpression, Severity.Warning, this.m_textBox.ObjectType, this.m_textBox.Name, "Value");
             throw new ReportProcessingException_InvalidOperationException();
         }
         this.m_isVisited = true;
         ObjectModelImpl           reportObjectModel = base.m_reportRT.ReportObjectModel;
         OnDemandProcessingContext odpContext        = base.m_reportRT.ReportObjectModel.OdpContext;
         bool          contextUpdated = base.m_reportRT.ContextUpdated;
         IInstancePath originalObject = null;
         base.m_reportRT.ContextUpdated = false;
         if (odpContext.IsTablixProcessingMode || calledFromValue)
         {
             originalObject = odpContext.LastRIFObject;
         }
         bool flag = this.m_textBox.Action != null && this.m_textBox.Action.TrackFieldsUsedInValueExpression;
         Dictionary <string, bool> dictionary = null;
         if (flag)
         {
             dictionary = new Dictionary <string, bool>();
         }
         try
         {
             bool flag2 = false;
             if (this.m_paragraphs.Count == 1)
             {
                 TextRunsImpl textRunsImpl = (TextRunsImpl)((Paragraphs)this.m_paragraphs)[0].TextRuns;
                 if (textRunsImpl.Count == 1)
                 {
                     flag2 = true;
                     TextRunImpl textRunImpl = (TextRunImpl)((TextRuns)textRunsImpl)[0];
                     this.m_result = textRunImpl.GetResult(romInstance);
                     if (flag)
                     {
                         textRunImpl.MergeFieldsUsedInValueExpression(dictionary);
                     }
                 }
             }
             if (!flag2)
             {
                 bool flag3 = false;
                 this.m_result = default(AspNetCore.ReportingServices.RdlExpressions.VariantResult);
                 StringBuilder stringBuilder = new StringBuilder();
                 for (int i = 0; i < this.m_paragraphs.Count; i++)
                 {
                     if (i > 0)
                     {
                         flag3 = true;
                         stringBuilder.Append(Environment.NewLine);
                     }
                     TextRunsImpl textRunsImpl2 = (TextRunsImpl)((Paragraphs)this.m_paragraphs)[i].TextRuns;
                     for (int j = 0; j < textRunsImpl2.Count; j++)
                     {
                         TextRunImpl textRunImpl2 = (TextRunImpl)((TextRuns)textRunsImpl2)[j];
                         AspNetCore.ReportingServices.RdlExpressions.VariantResult result = textRunImpl2.GetResult(romInstance);
                         if (result.Value != null)
                         {
                             if (result.TypeCode == TypeCode.Object && (result.Value is TimeSpan || result.Value is DateTimeOffset))
                             {
                                 string text = textRunImpl2.TextRunDef.FormatTextRunValue(result, odpContext);
                                 if (text != null)
                                 {
                                     result.Value = text;
                                 }
                                 else
                                 {
                                     result.Value = AspNetCore.ReportingServices.RdlExpressions.ReportRuntime.ConvertToStringFallBack(result.Value);
                                 }
                             }
                             flag3 = true;
                             stringBuilder.Append(result.Value);
                         }
                         if (flag)
                         {
                             textRunImpl2.MergeFieldsUsedInValueExpression(dictionary);
                         }
                     }
                 }
                 if (flag3)
                 {
                     this.m_result.Value    = stringBuilder.ToString();
                     this.m_result.TypeCode = TypeCode.String;
                 }
             }
             if (flag)
             {
                 this.m_fieldsUsedInValueExpression = new List <string>();
                 foreach (string key in dictionary.Keys)
                 {
                     this.m_fieldsUsedInValueExpression.Add(key);
                 }
             }
         }
         finally
         {
             odpContext.RestoreContext(originalObject);
             base.m_reportRT.ContextUpdated = contextUpdated;
             this.m_isVisited    = false;
             this.m_isValueReady = true;
         }
     }
     return(this.m_result);
 }
		private void PageInit(ReportSection section)
		{
			AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.ObjectModelImpl reportObjectModel = this.m_processingContext.ReportObjectModel;
			AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.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(AspNetCore.ReportingServices.RdlExpressions.VariantResult));
			section.PageSectionItemsForHeadFoot.ResetAll();
			reportObjectModel.GlobalsImpl.SetPageNumbers(base.m_currentPageNumber, base.m_totalPages, base.m_currentOverallPageNumber, base.m_overallTotalPages);
			reportObjectModel.GlobalsImpl.SetPageName(base.m_pageName);
			AspNetCore.ReportingServices.ReportIntermediateFormat.Report reportDef = base.m_romReport.ReportDef;
			AspNetCore.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef = section.SectionDef;
			AspNetCore.ReportingServices.ReportIntermediateFormat.Page page = sectionDef.Page;
			section.PageAggregatesOverReportItems = new Dictionary<string, AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.AggregatesImpl>();
			this.m_processingContext.ReportObjectModel.ReportItemsImpl.SpecialMode = true;
			if (page.PageAggregates != null)
			{
				for (int i = 0; i < page.PageAggregates.Count; i++)
				{
					AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = page.PageAggregates[i];
					aggregatesImpl.Remove(dataAggregateInfo);
					dataAggregateInfo.ExprHostInitialized = false;
					AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = new AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, this.m_processingContext);
					object[] array = default(object[]);
					DataFieldStatus dataFieldStatus = default(DataFieldStatus);
					dataAggregateObj.EvaluateParameters(out array, out dataFieldStatus);
					string specialModeIndex = reportObjectModel.ReportItemsImpl.GetSpecialModeIndex();
					if (specialModeIndex == null)
					{
						aggregatesImpl.Add(dataAggregateObj);
					}
					else
					{
						AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.AggregatesImpl aggregatesImpl2 = default(AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.AggregatesImpl);
						if (!section.PageAggregatesOverReportItems.TryGetValue(specialModeIndex, out aggregatesImpl2))
						{
							aggregatesImpl2 = new AspNetCore.ReportingServices.ReportProcessing.OnDemandReportObjectModel.AggregatesImpl(this.m_processingContext);
							section.PageAggregatesOverReportItems.Add(specialModeIndex, aggregatesImpl2);
						}
						aggregatesImpl2.Add(dataAggregateObj);
						this.m_reportItemToReportSection[specialModeIndex] = section;
					}
					dataAggregateObj.Init();
				}
			}
			reportObjectModel.ReportItemsImpl.SpecialMode = false;
			AspNetCore.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)
			{
				this.m_processingContext.SetupContext(rifObject, romInstance);
			}
		}
Example #5
0
 public FieldImpl(ObjectModelImpl reportOM, object value, bool isAggregationField, AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef)
 {
     this.m_reportOM = reportOM;
     this.m_fieldDef = fieldDef;
     this.UpdateValue(value, isAggregationField, DataFieldStatus.None, null);
 }