private void InitializeEnvironment() { m_processingContext = m_romReport.HeaderFooterRenderingContext.OdpContext; Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDef = m_romReport.ReportDef; ObjectModelImpl reportObjectModel = m_processingContext.ReportObjectModel; if (reportDef.DataSetsNotOnlyUsedInParameters == 1) { m_processingContext.SetupFieldsForNewDataSetPageSection(reportDef.FirstDataSet); } else { m_processingContext.SetupEmptyTopLevelFields(); } reportObjectModel.VariablesImpl = new VariablesImpl(lockAdd: false); if (reportDef.HasVariables) { Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance currentReportInstance = m_romReport.RenderingContext.OdpContext.CurrentReportInstance; m_processingContext.RuntimeInitializePageSectionVariables(reportDef, currentReportInstance?.VariableValues); } reportObjectModel.LookupsImpl = new LookupsImpl(); if (reportDef.HasLookups) { m_processingContext.RuntimeInitializeLookups(reportDef); } ReportItemsImpl reportItemsImpl = new ReportItemsImpl(lockAdd: false); foreach (ReportSection reportSection in m_romReport.ReportSections) { Microsoft.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef = reportSection.SectionDef; reportSection.BodyItemsForHeadFoot = new ReportItemsImpl(lockAdd: false); reportSection.PageSectionItemsForHeadFoot = new ReportItemsImpl(lockAdd: false); reportObjectModel.ReportItemsImpl = reportSection.BodyItemsForHeadFoot; m_processingContext.RuntimeInitializeTextboxObjs(sectionDef.ReportItems, setExprHost: false); reportObjectModel.ReportItemsImpl = reportSection.PageSectionItemsForHeadFoot; Microsoft.ReportingServices.ReportIntermediateFormat.Page page = sectionDef.Page; if (page.PageHeader != null) { if (m_processingContext.ReportRuntime.ReportExprHost != null) { page.PageHeader.SetExprHost(m_processingContext.ReportRuntime.ReportExprHost, reportObjectModel); } m_processingContext.RuntimeInitializeReportItemObjs(page.PageHeader.ReportItems, traverseDataRegions: false); m_processingContext.RuntimeInitializeTextboxObjs(page.PageHeader.ReportItems, setExprHost: true); } if (page.PageFooter != null) { if (m_processingContext.ReportRuntime.ReportExprHost != null) { page.PageFooter.SetExprHost(m_processingContext.ReportRuntime.ReportExprHost, reportObjectModel); } m_processingContext.RuntimeInitializeReportItemObjs(page.PageFooter.ReportItems, traverseDataRegions: false); m_processingContext.RuntimeInitializeTextboxObjs(page.PageFooter.ReportItems, setExprHost: true); } reportItemsImpl.AddAll(reportSection.BodyItemsForHeadFoot); reportItemsImpl.AddAll(reportSection.PageSectionItemsForHeadFoot); } reportObjectModel.ReportItemsImpl = reportItemsImpl; reportObjectModel.AggregatesImpl = new AggregatesImpl(m_processingContext); }
internal ReportSection GetContainingSection(OnDemandProcessingContext parentReportOdpContext) { if (m_containingSection == null) { m_containingSection = parentReportOdpContext.ReportDefinition.ReportSections[0]; } return(m_containingSection); }
public override void ResolveReferences(Dictionary <Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType, List <MemberReference> > memberReferencesCollection, Dictionary <int, IReferenceable> referenceableItems) { if (!memberReferencesCollection.TryGetValue(m_Declaration.ObjectType, out List <MemberReference> value)) { return; } foreach (MemberReference item in value) { switch (item.MemberName) { case MemberName.ContainingScopes: if (m_containingScopes == null) { m_containingScopes = new GroupingList(); } if (item.RefID != -2) { Global.Tracer.Assert(referenceableItems.ContainsKey(item.RefID)); Global.Tracer.Assert(referenceableItems[item.RefID] is Grouping); Global.Tracer.Assert(!m_containingScopes.Contains((Grouping)referenceableItems[item.RefID])); m_containingScopes.Add((Grouping)referenceableItems[item.RefID]); } else { m_containingScopes.Add(null); } break; case MemberName.ContainingSection: { referenceableItems.TryGetValue(item.RefID, out IReferenceable value2); m_containingSection = (ReportSection)value2; break; } default: Global.Tracer.Assert(condition: false); break; } } }
public override void Deserialize(IntermediateFormatReader reader) { base.Deserialize(reader); reader.RegisterDeclaration(m_Declaration); while (reader.NextMember()) { switch (reader.CurrentMember.MemberName) { case MemberName.Parameters: m_parameters = reader.ReadGenericListOfRIFObjects <ParameterValue>(); break; case MemberName.NoRowsMessage: m_noRowsMessage = (ExpressionInfo)reader.ReadRIFObject(); break; case MemberName.MergeTransactions: m_mergeTransactions = reader.ReadBoolean(); break; case MemberName.ContainingScopes: if (reader.ReadListOfReferencesNoResolution(this) == 0) { m_containingScopes = new GroupingList(); } break; case MemberName.IsTablixCellScope: m_isTablixCellScope = reader.ReadBoolean(); break; case MemberName.ReportName: m_reportName = reader.ReadString(); break; case MemberName.OmitBorderOnPageBreak: m_omitBorderOnPageBreak = reader.ReadBoolean(); break; case MemberName.KeepTogether: m_keepTogether = reader.ReadBoolean(); break; case MemberName.Location: m_location = (Microsoft.ReportingServices.ReportPublishing.LocationFlags)reader.ReadEnum(); break; case MemberName.IndexInCollection: m_indexInCollection = reader.ReadInt32(); break; case MemberName.ContainingSection: m_containingSection = reader.ReadReference <ReportSection>(this); break; default: Global.Tracer.Assert(condition: false); break; } } }
internal void SetContainingSection(ReportSection section) { m_containingSection = section; }
private void ValidateItemSizeAndBoundaries(InitializationContext context) { if (context.PublishingContext.PublishingContextKind == PublishingContextKind.DataShape) { return; } if (m_parent != null) { bool flag = true; if (m_width == null) { if ((context.Location & Microsoft.ReportingServices.ReportPublishing.LocationFlags.InTablix) == 0) { if (Microsoft.ReportingServices.ReportProcessing.ObjectType.Tablix == context.ObjectType) { m_width = "0mm"; m_widthValue = 0.0; flag = false; } else if (Microsoft.ReportingServices.ReportProcessing.ObjectType.PageHeader == context.ObjectType || Microsoft.ReportingServices.ReportProcessing.ObjectType.PageFooter == context.ObjectType) { ReportSection reportSection = m_parent as ReportSection; m_widthValue = reportSection.PageSectionWidth; m_width = Microsoft.ReportingServices.ReportPublishing.Converter.ConvertSize(m_widthValue); } else { m_widthValue = Math.Round(m_parent.m_widthValue - m_leftValue, 10); m_width = Microsoft.ReportingServices.ReportPublishing.Converter.ConvertSize(m_widthValue); } } else { flag = false; } } if (flag) { m_widthValue = context.ValidateSize(m_width, "Width"); } flag = true; if (m_height == null) { if ((context.Location & Microsoft.ReportingServices.ReportPublishing.LocationFlags.InTablix) == 0) { if (Microsoft.ReportingServices.ReportProcessing.ObjectType.Tablix == context.ObjectType) { m_height = "0mm"; m_heightValue = 0.0; flag = false; } else { m_heightValue = Math.Round(m_parent.m_heightValue - m_topValue, 10); m_height = Microsoft.ReportingServices.ReportPublishing.Converter.ConvertSize(m_heightValue); } } else { flag = false; } } if (flag) { m_heightValue = context.ValidateSize(m_height, "Height"); } } else { m_widthValue = context.ValidateSize(ref m_width, "Width"); m_heightValue = context.ValidateSize(ref m_height, "Height"); } if ((context.Location & Microsoft.ReportingServices.ReportPublishing.LocationFlags.InTablix) == 0) { ValidateParentBoundaries(context, context.ObjectType, context.ObjectName); } }
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); } }
internal ReportSection(Report reportDef, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef, int indexInCollection) : this(reportDef, indexInCollection) { m_sectionDef = sectionDef; }
internal PageSection(bool isHeader, int id, int idForReportItems, ReportSection reportSection) : base(id, reportSection) { m_reportItems = new ReportItemCollection(idForReportItems, normal: true); m_isHeader = isHeader; }
internal Body(IReportScope reportScope, IDefinitionPath parentDefinitionPath, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef, RenderingContext renderingContext) : base(reportScope, parentDefinitionPath, sectionDef, renderingContext) { }