public void RenderRPLPage(RPLReport report, bool headerInBody, bool suppressOutlines)
        {
            string         key            = null;
            LayoutEngine   layoutEngine   = new LayoutEngine(report, headerInBody, this.m_streamDelegate);
            RPLPageContent rPLPageContent = report.RPLPaginatedPages[0];

            this.m_excel.GenerateWorksheetName(rPLPageContent.PageLayout.PageName);
            RPLReportSection nextReportSection = rPLPageContent.GetNextReportSection();

            this.AddBackgroundImage(rPLPageContent, nextReportSection);
            Reader.ReadReportMeasurements(report, layoutEngine, suppressOutlines, nextReportSection);
            try
            {
                layoutEngine.RenderPageToExcel(this.m_excel, key, this.m_sharedBorderCache, this.m_sharedImageCache);
                if (layoutEngine.ScalabilityCache != null)
                {
                    this.m_totalScaleTimeMs += layoutEngine.ScalabilityCache.ScalabilityDurationMs;
                    this.m_peakMemoryUsageKB = Math.Max(this.m_peakMemoryUsageKB, layoutEngine.ScalabilityCache.PeakMemoryUsageKBytes);
                }
            }
            finally
            {
                layoutEngine.Dispose();
            }
        }
        internal override bool Render()
        {
            RPLItemMeasurement rPLItemMeasurement = null;
            bool             flag           = true;
            string           author         = "";
            string           title          = "";
            string           description    = "";
            AutoFit          autoFit        = m_writer.AutoFit;
            float            width          = 0f;
            float            leftMargin     = 0f;
            float            rightMargin    = 0f;
            RPLPageLayout    rplPageLayout  = null;
            List <RPLReport> rplReportCache = new List <RPLReport>();
            bool             hasHeaderSoFar = false;
            bool             hasFooterSoFar = false;
            SectionEntry     sectionEntry   = null;

            while (!m_spbProcessing.Done)
            {
                if (!flag)
                {
                    m_writer.WritePageBreak();
                }
                m_spbProcessing.GetNextPage(out m_rplReport);
                RPLPageContent   rPLPageContent   = m_rplReport.RPLPaginatedPages[0];
                RPLReportSection rPLReportSection = rPLPageContent.GetNextReportSection();
                bool             pageCached       = false;
                bool             firstSection     = true;
                while (rPLReportSection != null)
                {
                    rPLItemMeasurement = rPLReportSection.Columns[0];
                    float           width2 = rPLReportSection.BodyArea.Width;
                    RPLHeaderFooter footer = null;
                    SectionEntry    se     = null;
                    if (!firstSection || sectionEntry == null || string.CompareOrdinal(sectionEntry.SectionId, rPLReportSection.ID) != 0)
                    {
                        if (RSTrace.RenderingTracer.TraceVerbose)
                        {
                            RSTrace.RenderingTracer.Trace("The left or right margin is either <0 or the sum exceeds the page width.");
                        }
                        sectionEntry = (se = RenderHeaderFooters(rPLReportSection, firstSection, ref pageCached, rplReportCache, ref footer, ref hasHeaderSoFar, ref hasFooterSoFar));
                    }
                    flag  = SetFirstPageDimensions(flag, rPLPageContent, ref rplPageLayout, ref leftMargin, ref rightMargin, ref width, ref title, ref author, ref description);
                    width = RevisePageDimensions(leftMargin, rightMargin, width, width2, autoFit);
                    RenderHeaderBetweenSections(rPLReportSection, firstSection);
                    RenderBodyContent(width2, rPLItemMeasurement);
                    rPLReportSection = AdvanceToNextSection(rPLPageContent, rPLReportSection, ref firstSection, sectionEntry, footer, se);
                }
                if (!m_spbProcessing.Done && !pageCached)
                {
                    m_rplReport.Release();
                }
            }
            m_writer.WriteParagraphEnd();
            m_writer.SetPageDimensions(m_pageHeight, width, leftMargin, rightMargin, rplPageLayout.MarginTop, rplPageLayout.MarginBottom);
            FinishRendering(rplReportCache, title, author, description);
            return(true);
        }
        public override bool Render()
        {
            RPLItemMeasurement rPLItemMeasurement = null;
            bool             flag           = true;
            string           author         = "";
            string           title          = "";
            string           description    = "";
            AutoFit          autoFit        = base.m_writer.AutoFit;
            float            num            = 0f;
            float            leftMargin     = 0f;
            float            rightMargin    = 0f;
            RPLPageLayout    rPLPageLayout  = null;
            List <RPLReport> rplReportCache = new List <RPLReport>();
            bool             flag2          = false;
            bool             flag3          = false;
            SectionEntry     sectionEntry   = null;

            while (!base.m_spbProcessing.Done)
            {
                if (!flag)
                {
                    base.m_writer.WritePageBreak();
                }
                base.m_spbProcessing.GetNextPage(out base.m_rplReport);
                RPLPageContent   rPLPageContent   = base.m_rplReport.RPLPaginatedPages[0];
                RPLReportSection rPLReportSection = rPLPageContent.GetNextReportSection();
                bool             flag4            = false;
                bool             flag5            = true;
                while (rPLReportSection != null)
                {
                    rPLItemMeasurement = rPLReportSection.Columns[0];
                    float           width  = rPLReportSection.BodyArea.Width;
                    RPLHeaderFooter footer = null;
                    SectionEntry    se     = null;
                    if (!flag5 || sectionEntry == null || string.CompareOrdinal(sectionEntry.SectionId, rPLReportSection.ID) != 0)
                    {
                        if (RSTrace.RenderingTracer.TraceVerbose)
                        {
                            RSTrace.RenderingTracer.Trace("The left or right margin is either <0 or the sum exceeds the page width.");
                        }
                        sectionEntry = (se = this.RenderHeaderFooters(rPLReportSection, flag5, ref flag4, rplReportCache, ref footer, ref flag2, ref flag3));
                    }
                    flag = base.SetFirstPageDimensions(flag, rPLPageContent, ref rPLPageLayout, ref leftMargin, ref rightMargin, ref num, ref title, ref author, ref description);
                    num  = base.RevisePageDimensions(leftMargin, rightMargin, num, width, autoFit);
                    base.RenderHeaderBetweenSections(rPLReportSection, flag5);
                    base.RenderBodyContent(width, rPLItemMeasurement);
                    rPLReportSection = base.AdvanceToNextSection(rPLPageContent, rPLReportSection, ref flag5, sectionEntry, footer, se);
                }
                if (!base.m_spbProcessing.Done && !flag4)
                {
                    base.m_rplReport.Release();
                }
            }
            base.m_writer.WriteParagraphEnd();
            base.m_writer.SetPageDimensions(base.m_pageHeight, num, leftMargin, rightMargin, rPLPageLayout.MarginTop, rPLPageLayout.MarginBottom);
            base.FinishRendering(rplReportCache, title, author, description);
            return(true);
        }
示例#4
0
 public void AddToPage(RPLPageContent rplPageContent, out RPLMeasurement measurement)
 {
     measurement        = new RPLMeasurement();
     measurement.Left   = 0f;
     measurement.Top    = (float)this.m_itemPageSizes.Top;
     measurement.Width  = (float)this.m_pageSettings.UsablePageWidth;
     measurement.Height = (float)this.m_itemPageSizes.Height;
     rplPageContent.AddReportSection(this.m_rplElement);
 }
示例#5
0
        public virtual RectangleF CalculatePageBounds(RPLPageContent pageContent, out float pageWidth, out float pageHeight)
        {
            RPLPageLayout pageLayout = pageContent.PageLayout;

            pageWidth  = pageLayout.PageWidth;
            pageHeight = pageLayout.PageHeight;
            float width  = pageLayout.PageWidth - pageLayout.MarginLeft - pageLayout.MarginRight;
            float height = pageLayout.PageHeight - pageLayout.MarginTop - pageLayout.MarginBottom;

            return(new RectangleF(pageLayout.MarginLeft, pageLayout.MarginTop, width, height));
        }
            private void WriteImpl()
            {
                Version   rPLVersion = new Version(10, 6, 0);
                RPLReport rPLReport  = new RPLReport();

                rPLReport.ReportName        = base.Report.Name;
                rPLReport.Description       = base.Report.Description;
                rPLReport.Author            = base.Report.Author;
                rPLReport.AutoRefresh       = base.Report.AutoRefresh;
                rPLReport.ExecutionTime     = base.Report.ExecutionTime;
                rPLReport.Location          = base.Report.Location.ToString();
                rPLReport.Language          = Microsoft.ReportingServices.Rendering.HPBProcessing.Report.GetReportLanguage(base.Report);
                rPLReport.RPLVersion        = rPLVersion;
                rPLReport.RPLPaginatedPages = new RPLPageContent[1];
                base.RplWriter.Report       = rPLReport;
                RPLReportSection rPLReportSection = new RPLReportSection(1);

                rPLReportSection.ID          = base.ReportSection.ID;
                rPLReportSection.ColumnCount = 1;
                RPLBody            rPLBody            = new RPLBody();
                RPLItemMeasurement rPLItemMeasurement = new RPLItemMeasurement();

                rPLItemMeasurement.Left          = 0f;
                rPLItemMeasurement.Top           = 0f;
                rPLItemMeasurement.Width         = base.Width;
                rPLItemMeasurement.Height        = base.Height;
                rPLItemMeasurement.ZIndex        = 0;
                rPLItemMeasurement.State         = 0;
                rPLItemMeasurement.Element       = rPLBody;
                rPLReportSection.Columns[0]      = rPLItemMeasurement;
                rPLReportSection.BodyArea        = new RPLMeasurement();
                rPLReportSection.BodyArea.Top    = 0f;
                rPLReportSection.BodyArea.Height = base.Height;
                m_pageItem.WriteStartItemToStream(base.RplWriter, base.PageContext);
                RPLItemMeasurement[] array2 = rPLBody.Children = new RPLItemMeasurement[1];
                array2[0] = m_pageItem.WritePageItemSizes();
                RPLPageLayout rPLPageLayout = new RPLPageLayout();

                rPLPageLayout.PageHeight = base.Height;
                rPLPageLayout.PageWidth  = base.Width;
                rPLPageLayout.Style      = new RPLElementStyle(null, null);
                RPLPageContent rPLPageContent = new RPLPageContent(1, rPLPageLayout);
                RPLMeasurement rPLMeasurement = new RPLMeasurement();

                rPLMeasurement.Left   = 0f;
                rPLMeasurement.Top    = 0f;
                rPLMeasurement.Width  = base.Width;
                rPLMeasurement.Height = base.Height;
                rPLPageContent.ReportSectionSizes[0] = rPLMeasurement;
                rPLPageContent.AddReportSection(rPLReportSection);
                base.RplWriter.Report.RPLPaginatedPages[0] = rPLPageContent;
            }
示例#7
0
        internal void AddBackgroundImage(RPLPageContent pageContent, RPLReportSection reportSection)
        {
            RPLImageData rPLImageData = (RPLImageData)((RPLBody)reportSection.Columns[0].Element).ElementProps.Style[33];

            if (rPLImageData == null)
            {
                rPLImageData = (RPLImageData)pageContent.PageLayout.Style[33];
            }
            if (rPLImageData != null && rPLImageData.ImageData != null && rPLImageData.ImageData.Length != 0)
            {
                m_excel.AddBackgroundImage(rPLImageData.ImageData, rPLImageData.ImageName, ref m_backgroundImage, ref m_backgroundImageWidth, ref m_backgroundImageHeight);
            }
        }
示例#8
0
        private void WriteEndItemToRPLOM(RPLWriter rplWriter, int sectionStartIndex, string pageName)
        {
            RPLPageContent rPLPageContent = rplWriter.Report.RPLPaginatedPages[0];

            rPLPageContent.PageLayout.PageName = pageName;
            RPLSizes[] array = new RPLSizes[this.m_sectionSizes.Count];
            for (int i = 0; i < this.m_sectionSizes.Count; i++)
            {
                array[i] = new RPLSizes((float)this.m_sectionSizes[i].Top, (float)this.m_sectionSizes[i].Left, (float)this.m_sectionSizes[i].Height, (float)this.m_sectionSizes[i].Width);
            }
            rPLPageContent.ReportSectionSizes = array;
            for (int j = sectionStartIndex; j <= this.m_lastSectionIndex; j++)
            {
                rPLPageContent.AddReportSection(this.m_sections[j].RPLReportSection);
            }
        }
        internal RenderingReport(GdiContext context)
        {
            RPLPageContent rPLPageContent = context.RplReport.RPLPaginatedPages[0];
            RPLPageLayout  pageLayout     = rPLPageContent.PageLayout;

            context.RenderingReport = this;
            float maxSectionWidth = rPLPageContent.MaxSectionWidth;

            m_position.X      = float.MaxValue;
            m_position.Y      = 0f;
            m_position.Width  = maxSectionWidth;
            m_position.Height = 0f;
            m_reportSections  = new List <RenderingReportSection>(rPLPageContent.ReportSectionSizes.Length);
            int num = 0;

            while (rPLPageContent.HasNextReportSection())
            {
                RPLReportSection nextReportSection = rPLPageContent.GetNextReportSection();
                RPLSizes         rPLSizes          = rPLPageContent.ReportSectionSizes[num];
                m_reportSections.Add(new RenderingReportSection(context, nextReportSection, rPLSizes, num, maxSectionWidth, m_position.Height));
                m_position.X       = Math.Min(m_position.X, rPLSizes.Left);
                m_position.Height += rPLSizes.Height;
                num++;
            }
            object obj = pageLayout.Style[34];

            if (obj != null)
            {
                BackgroundColor = new RPLReportColor((string)obj).ToColor();
            }
            object obj2 = pageLayout.Style[33];

            if (obj2 != null)
            {
                BackgroundImage = RenderingItem.GetImage(context, (RPLImageData)obj2);
                object obj3 = pageLayout.Style[35];
                if (obj3 == null)
                {
                    BackgroundRepeat = RPLFormat.BackgroundRepeatTypes.Repeat;
                }
                else
                {
                    BackgroundRepeat = (RPLFormat.BackgroundRepeatTypes)obj3;
                }
            }
            ProcessBorders(context.GdiWriter, pageLayout.Style, m_position, m_position, 0);
        }
示例#10
0
        public void WriteEndItemToStream(RPLWriter rplWriter, List <ReportSection> sectionsOnPage)
        {
            BinaryWriter binaryWriter = rplWriter.BinaryWriter;

            if (binaryWriter != null)
            {
                rplWriter.BinaryWriter.Write((byte)255);
                Stream baseStream = binaryWriter.BaseStream;
                long   position   = baseStream.Position;
                binaryWriter.Write((byte)16);
                binaryWriter.Write(this.m_pageOffset);
                int count = sectionsOnPage.Count;
                binaryWriter.Write(count);
                for (int i = 0; i < count; i++)
                {
                    sectionsOnPage[i].WriteMeasurement(binaryWriter);
                }
                this.m_pageOffset = baseStream.Position;
                binaryWriter.Write((byte)254);
                binaryWriter.Write(position);
                binaryWriter.Write((byte)255);
                position = baseStream.Position;
                binaryWriter.Write((byte)18);
                binaryWriter.Write(this.m_offset);
                binaryWriter.Write(1);
                binaryWriter.Write(this.m_pageOffset);
                binaryWriter.Write((byte)254);
                binaryWriter.Write(position);
                binaryWriter.Write((byte)255);
            }
            else
            {
                int            count2         = sectionsOnPage.Count;
                ReportSection  reportSection  = sectionsOnPage[0];
                RPLPageLayout  pageLayout     = reportSection.WritePageLayout(rplWriter, this.m_pageContext);
                RPLPageContent rPLPageContent = new RPLPageContent(count2, pageLayout);
                for (int j = 0; j < count2; j++)
                {
                    RPLMeasurement rPLMeasurement = null;
                    sectionsOnPage[j].AddToPage(rPLPageContent, out rPLMeasurement);
                    rPLPageContent.ReportSectionSizes[j] = rPLMeasurement;
                }
                rplWriter.Report.RPLPaginatedPages[0] = rPLPageContent;
            }
        }
        internal override bool Render()
        {
            RPLItemMeasurement rPLItemMeasurement = null;
            bool             flag           = true;
            string           author         = "";
            string           title          = "";
            string           description    = "";
            AutoFit          autoFit        = m_writer.AutoFit;
            float            width          = 0f;
            float            leftMargin     = 0f;
            float            rightMargin    = 0f;
            RPLPageLayout    rplPageLayout  = null;
            bool             flag2          = false;
            List <RPLReport> rplReportCache = new List <RPLReport>();

            while (!m_spbProcessing.Done)
            {
                if (!flag)
                {
                    m_writer.WritePageBreak();
                }
                m_spbProcessing.GetNextPage(out m_rplReport);
                RPLPageContent   rPLPageContent   = m_rplReport.RPLPaginatedPages[0];
                RPLReportSection rPLReportSection = rPLPageContent.GetNextReportSection();
                bool             pageCached       = false;
                bool             firstSection     = true;
                while (rPLReportSection != null)
                {
                    rPLItemMeasurement = rPLReportSection.Columns[0];
                    float           width2       = rPLReportSection.BodyArea.Width;
                    RPLHeaderFooter footer       = null;
                    SectionEntry    sectionEntry = null;
                    if (!firstSection || m_sections.Count == 0 || string.CompareOrdinal(m_sections[m_sections.Count - 1].SectionId, rPLReportSection.ID) != 0)
                    {
                        if (RSTrace.RenderingTracer.TraceVerbose)
                        {
                            RSTrace.RenderingTracer.Trace("The left or right margin is either <0 or the sum exceeds the page width.");
                        }
                        sectionEntry = new SectionEntry(rPLReportSection);
                        if (rPLReportSection.Footer != null)
                        {
                            footer = (rPLReportSection.Footer.Element as RPLHeaderFooter);
                        }
                        if (sectionEntry.HeaderMeasurement != null || sectionEntry.FooterMeasurement != null)
                        {
                            flag2 = true;
                        }
                        m_sections.Add(sectionEntry);
                        CachePage(ref pageCached, rplReportCache);
                    }
                    flag  = SetFirstPageDimensions(flag, rPLPageContent, ref rplPageLayout, ref leftMargin, ref rightMargin, ref width, ref title, ref author, ref description);
                    width = RevisePageDimensions(leftMargin, rightMargin, width, width2, autoFit);
                    RenderHeaderBetweenSections(rPLReportSection, firstSection);
                    RenderBodyContent(width2, rPLItemMeasurement);
                    rPLReportSection = AdvanceToNextSection(rPLPageContent, rPLReportSection, ref firstSection, m_sections[m_sections.Count - 1], footer, sectionEntry);
                }
                if (!m_spbProcessing.Done && !pageCached)
                {
                    m_rplReport.Release();
                }
            }
            m_writer.WriteParagraphEnd();
            m_writer.SetPageDimensions(m_pageHeight, width, leftMargin, rightMargin, rplPageLayout.MarginTop, rplPageLayout.MarginBottom);
            if (flag2)
            {
                m_inHeaderFooter = true;
                m_writer.InitHeaderFooter();
                bool flag3 = false;
                m_needsToResetTextboxes = true;
                for (int i = 0; i < m_sections.Count; i++)
                {
                    RPLItemMeasurement headerMeasurement = m_sections[i].HeaderMeasurement;
                    if (headerMeasurement != null)
                    {
                        RenderRectangle((RPLContainer)headerMeasurement.Element, 0f, canGrow: true, headerMeasurement, new BorderContext(), inTablix: false, ignoreStyles: true);
                    }
                    m_writer.FinishHeader(i);
                    RPLItemMeasurement footerMeasurement = m_sections[i].FooterMeasurement;
                    if (footerMeasurement != null)
                    {
                        RenderRectangle((RPLContainer)footerMeasurement.Element, 0f, canGrow: true, footerMeasurement, new BorderContext(), inTablix: false, ignoreStyles: true);
                    }
                    m_writer.FinishFooter(i);
                    if (i != 0)
                    {
                        continue;
                    }
                    bool flag4 = headerMeasurement != null;
                    bool flag5 = flag4 && !(headerMeasurement.Element.ElementPropsDef as RPLHeaderFooterPropsDef).PrintOnFirstPage;
                    bool flag6 = footerMeasurement != null;
                    bool flag7 = flag6 && !(footerMeasurement.Element.ElementPropsDef as RPLHeaderFooterPropsDef).PrintOnFirstPage;
                    flag3 = ((flag5 || flag7) && (flag4 || flag6));
                    if (flag3)
                    {
                        if (flag4 && !flag5)
                        {
                            RenderRectangle((RPLContainer)headerMeasurement.Element, 0f, canGrow: true, headerMeasurement, new BorderContext(), inTablix: false, ignoreStyles: true);
                        }
                        m_writer.FinishHeader(i, Word97Writer.HeaderFooterLocation.First);
                        if (flag6 && !flag7)
                        {
                            RenderRectangle((RPLContainer)footerMeasurement.Element, 0f, canGrow: true, footerMeasurement, new BorderContext(), inTablix: false, ignoreStyles: true);
                        }
                        m_writer.FinishFooter(i, Word97Writer.HeaderFooterLocation.First);
                    }
                    m_needsToResetTextboxes = false;
                }
                m_writer.FinishHeadersFooters(flag3);
                m_inHeaderFooter = false;
            }
            FinishRendering(rplReportCache, title, author, description);
            return(true);
        }
        public override bool Render()
        {
            RPLItemMeasurement rPLItemMeasurement = null;
            bool             flag           = true;
            string           author         = "";
            string           title          = "";
            string           description    = "";
            AutoFit          autoFit        = base.m_writer.AutoFit;
            float            num            = 0f;
            float            leftMargin     = 0f;
            float            rightMargin    = 0f;
            RPLPageLayout    rPLPageLayout  = null;
            bool             flag2          = false;
            List <RPLReport> rplReportCache = new List <RPLReport>();

            while (!base.m_spbProcessing.Done)
            {
                if (!flag)
                {
                    base.m_writer.WritePageBreak();
                }
                base.m_spbProcessing.GetNextPage(out base.m_rplReport);
                RPLPageContent   rPLPageContent   = base.m_rplReport.RPLPaginatedPages[0];
                RPLReportSection rPLReportSection = rPLPageContent.GetNextReportSection();
                bool             flag3            = false;
                bool             flag4            = true;
                while (rPLReportSection != null)
                {
                    rPLItemMeasurement = rPLReportSection.Columns[0];
                    float           width        = rPLReportSection.BodyArea.Width;
                    RPLHeaderFooter footer       = null;
                    SectionEntry    sectionEntry = null;
                    if (!flag4 || this.m_sections.Count == 0 || string.CompareOrdinal(this.m_sections[this.m_sections.Count - 1].SectionId, rPLReportSection.ID) != 0)
                    {
                        if (RSTrace.RenderingTracer.TraceVerbose)
                        {
                            RSTrace.RenderingTracer.Trace("The left or right margin is either <0 or the sum exceeds the page width.");
                        }
                        sectionEntry = new SectionEntry(rPLReportSection);
                        if (rPLReportSection.Footer != null)
                        {
                            footer = (rPLReportSection.Footer.Element as RPLHeaderFooter);
                        }
                        if (sectionEntry.HeaderMeasurement != null || sectionEntry.FooterMeasurement != null)
                        {
                            flag2 = true;
                        }
                        this.m_sections.Add(sectionEntry);
                        base.CachePage(ref flag3, rplReportCache);
                    }
                    flag = base.SetFirstPageDimensions(flag, rPLPageContent, ref rPLPageLayout, ref leftMargin, ref rightMargin, ref num, ref title, ref author, ref description);
                    num  = base.RevisePageDimensions(leftMargin, rightMargin, num, width, autoFit);
                    base.RenderHeaderBetweenSections(rPLReportSection, flag4);
                    base.RenderBodyContent(width, rPLItemMeasurement);
                    rPLReportSection = base.AdvanceToNextSection(rPLPageContent, rPLReportSection, ref flag4, this.m_sections[this.m_sections.Count - 1], footer, sectionEntry);
                }
                if (!base.m_spbProcessing.Done && !flag3)
                {
                    base.m_rplReport.Release();
                }
            }
            base.m_writer.WriteParagraphEnd();
            base.m_writer.SetPageDimensions(base.m_pageHeight, num, leftMargin, rightMargin, rPLPageLayout.MarginTop, rPLPageLayout.MarginBottom);
            if (flag2)
            {
                base.m_inHeaderFooter = true;
                base.m_writer.InitHeaderFooter();
                bool flag5 = false;
                base.m_needsToResetTextboxes = true;
                for (int i = 0; i < this.m_sections.Count; i++)
                {
                    RPLItemMeasurement headerMeasurement = this.m_sections[i].HeaderMeasurement;
                    if (headerMeasurement != null)
                    {
                        base.RenderRectangle((RPLContainer)headerMeasurement.Element, 0f, true, headerMeasurement, new BorderContext(), false, true);
                    }
                    base.m_writer.FinishHeader(i);
                    RPLItemMeasurement footerMeasurement = this.m_sections[i].FooterMeasurement;
                    if (footerMeasurement != null)
                    {
                        base.RenderRectangle((RPLContainer)footerMeasurement.Element, 0f, true, footerMeasurement, new BorderContext(), false, true);
                    }
                    base.m_writer.FinishFooter(i);
                    if (i == 0)
                    {
                        bool flag6 = headerMeasurement != null;
                        bool flag7 = flag6 && !(headerMeasurement.Element.ElementPropsDef as RPLHeaderFooterPropsDef).PrintOnFirstPage;
                        bool flag8 = footerMeasurement != null;
                        bool flag9 = flag8 && !(footerMeasurement.Element.ElementPropsDef as RPLHeaderFooterPropsDef).PrintOnFirstPage;
                        flag5 = ((flag7 || flag9) && (flag6 || flag8));
                        if (flag5)
                        {
                            if (flag6 && !flag7)
                            {
                                base.RenderRectangle((RPLContainer)headerMeasurement.Element, 0f, true, headerMeasurement, new BorderContext(), false, true);
                            }
                            base.m_writer.FinishHeader(i, Word97Writer.HeaderFooterLocation.First);
                            if (flag8 && !flag9)
                            {
                                base.RenderRectangle((RPLContainer)footerMeasurement.Element, 0f, true, footerMeasurement, new BorderContext(), false, true);
                            }
                            base.m_writer.FinishFooter(i, Word97Writer.HeaderFooterLocation.First);
                        }
                        base.m_needsToResetTextboxes = false;
                    }
                }
                base.m_writer.FinishHeadersFooters(flag5);
                base.m_inHeaderFooter = false;
            }
            base.FinishRendering(rplReportCache, title, author, description);
            return(true);
        }
示例#13
0
        public static void ReadReportMeasurements(RPLReport report, ALayout layout, bool suppressOutlines, RPLReportSection firstReportSection)
        {
            int            num            = 0;
            int            left           = 0;
            int            num2           = 0;
            int            num3           = 0;
            int            left2          = 0;
            int            num4           = 0;
            int            num5           = 0;
            int            left3          = 0;
            int            num6           = 0;
            RPLPageContent rPLPageContent = report.RPLPaginatedPages[0];
            RPLPageLayout  pageLayout     = rPLPageContent.PageLayout;
            int            width          = LayoutConvert.ConvertMMTo20thPoints((double)rPLPageContent.MaxSectionWidth);

            for (RPLReportSection rPLReportSection = firstReportSection; rPLReportSection != null; rPLReportSection = rPLPageContent.GetNextReportSection())
            {
                layout.SetIsLastSection(!rPLPageContent.HasNextReportSection());
                RPLItemMeasurement rPLItemMeasurement = rPLReportSection.Columns[0];
                ALayout            pageHeaderLayout;
                if (rPLReportSection.Header != null)
                {
                    num             += LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Header.Top);
                    left             = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Header.Left);
                    num2             = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Header.Height);
                    pageHeaderLayout = layout.GetPageHeaderLayout(rPLReportSection.Header.Width, rPLReportSection.Header.Height);
                    if (num2 > 0)
                    {
                        if (pageLayout.Style != null)
                        {
                            pageHeaderLayout.AddReportItem(pageLayout, num, left, width, num2, 0, 0, null, null);
                        }
                        pageHeaderLayout.AddReportItem(rPLReportSection.Header.Element.RPLSource, num, left, width, num2, 0, 0, null, null);
                    }
                }
                else
                {
                    pageHeaderLayout = layout.GetPageHeaderLayout(0f, 0f);
                }
                if (rPLItemMeasurement != null)
                {
                    num3 += LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Top);
                    left2 = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Left);
                    num4  = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Height);
                    if (layout.HeaderInBody)
                    {
                        num3 += num2;
                    }
                    if (layout.FooterInBody)
                    {
                        num5 = num3 + num4;
                    }
                    if (pageLayout.Style != null)
                    {
                        layout.AddReportItem(pageLayout, num3, left2, width, num4, 0, rPLItemMeasurement.State, null, null);
                    }
                    layout.AddReportItem(rPLItemMeasurement.Element.RPLSource, num3, left2, width, num4, 0, rPLItemMeasurement.State, null, null);
                }
                ALayout pageFooterLayout;
                if (rPLReportSection.Footer != null)
                {
                    num5            += LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Footer.Top);
                    left3            = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Footer.Left);
                    num6             = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Footer.Height);
                    pageFooterLayout = layout.GetPageFooterLayout(rPLReportSection.Footer.Width, rPLReportSection.Footer.Height);
                    if (num6 > 0)
                    {
                        if (pageLayout.Style != null)
                        {
                            pageFooterLayout.AddReportItem(pageLayout, num5, left3, width, num6, 0, 0, null, null);
                        }
                        pageFooterLayout.AddReportItem(rPLReportSection.Footer.Element.RPLSource, num5, left3, width, num6, 0, 0, null, null);
                    }
                }
                else
                {
                    pageFooterLayout = layout.GetPageFooterLayout(0f, 0f);
                }
                Dictionary <string, ToggleParent> toggleParents = null;
                if (!suppressOutlines)
                {
                    toggleParents = new Dictionary <string, ToggleParent>();
                }
                if (rPLReportSection.Header != null)
                {
                    Reader.ReadMeasurement(rPLReportSection.Header.Element, pageHeaderLayout, num, left, 1, BlockOutlines.None, toggleParents, suppressOutlines, 0, null);
                }
                if (rPLItemMeasurement != null)
                {
                    Reader.ReadMeasurement(rPLItemMeasurement.Element, layout, num3, left2, 1, BlockOutlines.None, toggleParents, suppressOutlines, 0, null);
                }
                if (rPLReportSection.Footer != null)
                {
                    Reader.ReadMeasurement(rPLReportSection.Footer.Element, pageFooterLayout, num5, left3, 1, BlockOutlines.None, toggleParents, suppressOutlines, 0, null);
                }
                int num7 = num3 + num4;
                if (layout.FooterInBody)
                {
                    num7 += num6;
                }
                num3 = (num = (num5 = num7));
                num4 = 0;
                num6 = 0;
                num2 = 0;
                rPLReportSection.Columns[0] = null;
                rPLReportSection.Header     = null;
                rPLReportSection.Footer     = null;
                layout.CompleteSection();
            }
            layout.CompletePage();
        }