internal ItemContext(RPLWriter rplWriter, PageContext pageContext, Microsoft.ReportingServices.OnDemandReportRendering.Report report, Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
 {
     RPLWriter     = rplWriter;
     PageContext   = pageContext;
     Report        = report;
     ReportSection = reportSection;
 }
Ejemplo n.º 2
0
 internal Page(IDefinitionPath parentDefinitionPath, Microsoft.ReportingServices.ReportRendering.Report renderReport, RenderingContext renderingContext, ReportSection reportSection)
     : base(parentDefinitionPath, renderingContext)
 {
     m_isOldSnapshot = true;
     m_renderReport  = renderReport;
     m_reportSection = reportSection;
 }
        internal void RenderReportItem(RPLWriter rplWriter, string reportItemName)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection = null;
            ReportItem       obj      = FindReportItem(m_report, SplitReportItemPath(reportItemName), out reportSection) ?? throw new SelectiveRenderingCannotFindReportItemException(reportItemName);
            CustomReportItem criOwner = obj.CriOwner;

            if (criOwner != null)
            {
                criOwner.DynamicWidth  = ReportSize.FromMillimeters(m_paginationSettings.PhysicalPageWidth);
                criOwner.DynamicHeight = ReportSize.FromMillimeters(m_paginationSettings.PhysicalPageHeight);
            }
            PageItem pageItem = PageItem.Create(obj, tablixCellParent: false, m_pageContext);

            pageItem.ItemPageSizes.Top    = 0.0;
            pageItem.ItemPageSizes.Left   = 0.0;
            pageItem.ItemPageSizes.Width  = m_paginationSettings.PhysicalPageWidth;
            pageItem.ItemPageSizes.Height = m_paginationSettings.PhysicalPageHeight;
            ItemContext itemContext = new ItemContext(rplWriter, m_pageContext, m_report, reportSection);

            if (rplWriter.BinaryWriter != null)
            {
                ReportToRplStreamWriter.Write(pageItem, itemContext);
            }
            else
            {
                ReportToRplOmWriter.Write(pageItem, itemContext);
            }
            Done = true;
        }
Ejemplo n.º 4
0
 internal Page(IDefinitionPath parentDefinitionPath, RenderingContext renderingContext, ReportSection reportSection)
     : base(null, parentDefinitionPath, reportSection.SectionDef, renderingContext)
 {
     m_isOldSnapshot = false;
     m_pageDef       = reportSection.SectionDef.Page;
     m_reportSection = reportSection;
 }
Ejemplo n.º 5
0
 internal ReportSection(Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection, PageContext pageContext, PaginationSettings paginationSettings, SectionPaginationSettings sectionPaginationSettings)
 {
     m_reportSection       = reportSection;
     m_pageContext         = pageContext;
     m_pageSettings        = paginationSettings;
     m_sectionPageSettings = sectionPaginationSettings;
 }
 internal override void Reset(ReportSection section, int newPageNumber, int newTotalPages, int newOverallPageNumber, int newOverallTotalPages)
 {
     base.Reset(section, newPageNumber, newTotalPages, newOverallPageNumber, newOverallTotalPages);
     if (section.Page.PageHeader != null || section.Page.PageFooter != null)
     {
         PageInit(section);
     }
 }
 public SectionPaginationSettings(Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
 {
     m_columns       = reportSection.Page.Columns;
     m_columnSpacing = reportSection.Page.ColumnSpacing.ToMillimeters();
     if (reportSection.Page.PageHeader != null)
     {
         m_headerHeight = reportSection.Page.PageHeader.Height.ToMillimeters();
     }
     if (reportSection.Page.PageFooter != null)
     {
         m_footerHeight = reportSection.Page.PageFooter.Height.ToMillimeters();
     }
 }
        internal override void UpdatePageSections(ReportSection section)
        {
            if (section.Page.PageHeader == null && section.Page.PageFooter == null)
            {
                return;
            }
            ObjectModelImpl reportObjectModel = m_processingContext.ReportObjectModel;

            reportObjectModel.GlobalsImpl.SetPageName(m_pageName);
            if (section.PageAggregatesOverReportItems == null)
            {
                throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidPageSectionState, section.SectionIndex);
            }
            foreach (AggregatesImpl value in section.PageAggregatesOverReportItems.Values)
            {
                foreach (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj @object in value.Objects)
                {
                    reportObjectModel.AggregatesImpl.Add(@object);
                }
            }
            section.PageAggregatesOverReportItems = null;
        }
Ejemplo n.º 9
0
 internal override void UpdatePageSections(ReportSection section)
 {
     Microsoft.ReportingServices.ReportRendering.PageSection header = null;
     Microsoft.ReportingServices.ReportRendering.PageSection footer = null;
     foreach (AggregatesImpl value in m_aggregatesOverReportItems.Values)
     {
         foreach (DataAggregateObj @object in value.Objects)
         {
             m_processingContext.ReportObjectModel.AggregatesImpl.Add(@object);
         }
     }
     if (m_report.PageHeaderEvaluation)
     {
         header = GenerateRenderPageSection(m_report.PageHeader, "ph");
     }
     if (m_report.PageFooterEvaluation)
     {
         footer = GenerateRenderPageSection(m_report.PageFooter, "pf");
     }
     m_aggregates = null;
     m_aggregatesOverReportItems = null;
     section.Page.UpdateWithCurrentPageSections(header, footer);
 }
Ejemplo n.º 10
0
 internal ReportSection(Microsoft.ReportingServices.OnDemandReportRendering.ReportSection section, PageContext pageContext)
 {
     m_reportSectionDef = section;
     m_pageContext      = pageContext;
 }
Ejemplo n.º 11
0
 internal override void Reset(ReportSection section, int newPageNumber, int newTotalPages, int newOverallPageNumber, int newOverallTotalPages)
 {
     base.Reset(section, newPageNumber, newTotalPages, newOverallPageNumber, newOverallTotalPages);
     PageInit();
 }
        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);
            }
        }
        private static ReportItem FindReportItem(Microsoft.ReportingServices.OnDemandReportRendering.Report report, IEnumerable <string> reportItemPathSteps, out Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
        {
            reportSection = null;
            int num = reportItemPathSteps.Count();

            if (num == 0)
            {
                return(null);
            }
            bool       flag       = num > 1;
            string     text       = reportItemPathSteps.FirstOrDefault();
            ReportItem reportItem = null;

            foreach (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection2 in report.ReportSections)
            {
                foreach (ReportItem item in reportSection2.Body.ReportItemCollection)
                {
                    if (flag)
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = item as Microsoft.ReportingServices.OnDemandReportRendering.SubReport;
                        if (subReport != null && subReport.Report != null && string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = FindReportItem(subReport.Report, reportItemPathSteps.Skip(1), out reportSection);
                        }
                    }
                    else
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = item as Microsoft.ReportingServices.OnDemandReportRendering.Rectangle;
                        if (rectangle != null)
                        {
                            reportItem = FindReportItem(rectangle, text);
                        }
                        else if (string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = item;
                        }
                    }
                    if (reportItem != null)
                    {
                        reportSection = reportSection2;
                        return(reportItem);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 14
0
 private void WriteReportPageLayout2008(RPLWriter rplWriter, double bodyWidth, double bodyHeight)
 {
     if (rplWriter != null)
     {
         BinaryWriter binaryWriter = rplWriter.BinaryWriter;
         Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection = m_report.ReportSections[0];
         Page page = reportSection.Page;
         if (binaryWriter != null)
         {
             Stream baseStream = binaryWriter.BaseStream;
             long   position   = baseStream.Position;
             binaryWriter.Write((byte)16);
             binaryWriter.Write(m_columnsOffset);
             binaryWriter.Write(1);
             binaryWriter.Write(0f);
             binaryWriter.Write(0f);
             binaryWriter.Write((float)bodyWidth);
             binaryWriter.Write((float)bodyHeight);
             binaryWriter.Write(0);
             binaryWriter.Write((byte)0);
             binaryWriter.Write(m_bodyOffset);
             m_columnsOffset = baseStream.Position;
             binaryWriter.Write((byte)254);
             binaryWriter.Write(position);
             binaryWriter.Write(byte.MaxValue);
             binaryWriter.Write((byte)1);
             binaryWriter.Write((byte)3);
             binaryWriter.Write((byte)1);
             binaryWriter.Write(reportSection.ID);
             binaryWriter.Write((byte)0);
             binaryWriter.Write(page.Instance.UniqueName);
             binaryWriter.Write((byte)16);
             binaryWriter.Write((float)page.PageHeight.ToMillimeters());
             binaryWriter.Write((byte)17);
             binaryWriter.Write((float)page.PageWidth.ToMillimeters());
             binaryWriter.Write((byte)20);
             binaryWriter.Write((float)page.BottomMargin.ToMillimeters());
             binaryWriter.Write((byte)19);
             binaryWriter.Write((float)page.LeftMargin.ToMillimeters());
             binaryWriter.Write((byte)21);
             binaryWriter.Write((float)page.RightMargin.ToMillimeters());
             binaryWriter.Write((byte)18);
             binaryWriter.Write((float)page.TopMargin.ToMillimeters());
             binaryWriter.Write((byte)23);
             binaryWriter.Write(page.Columns);
             binaryWriter.Write((byte)22);
             binaryWriter.Write((float)page.ColumnSpacing.ToMillimeters());
             new ReportPageLayout(page).WriteElementStyle(rplWriter, m_pageContext);
             binaryWriter.Write(byte.MaxValue);
         }
         else
         {
             RPLPageLayout rPLPageLayout = new RPLPageLayout();
             rplWriter.Report.RPLPaginatedPages[0].PageLayout = rPLPageLayout;
             rPLPageLayout.PageHeight   = (float)page.PageHeight.ToMillimeters();
             rPLPageLayout.PageWidth    = (float)page.PageWidth.ToMillimeters();
             rPLPageLayout.MarginBottom = (float)page.BottomMargin.ToMillimeters();
             rPLPageLayout.MarginLeft   = (float)page.LeftMargin.ToMillimeters();
             rPLPageLayout.MarginRight  = (float)page.RightMargin.ToMillimeters();
             rPLPageLayout.MarginTop    = (float)page.TopMargin.ToMillimeters();
             new ReportPageLayout(page).WriteElementStyle(rplWriter, m_pageContext);
         }
     }
 }
Ejemplo n.º 15
0
 private void Visit(Microsoft.ReportingServices.OnDemandReportRendering.ReportSection section)
 {
     Visit(section.Body.ReportItemCollection);
     VisitStyle(section.Body.Style);
     VisitStyle(section.Page.Style);
 }
 internal ReportSectionInstance(ReportSection sectionDef)
     : base(sectionDef)
 {
 }