Пример #1
0
 private void WriteStartSectionItemToRPLOM(RPLWriter rplWriter)
 {
     m_rplReportSection               = new RPLReportSection(1);
     m_rplReportSection.ID            = m_reportSectionDef.ID;
     m_rplReportSection.ColumnSpacing = (float)m_reportSectionDef.Page.ColumnSpacing.ToMillimeters();
     m_rplReportSection.ColumnCount   = m_reportSectionDef.Page.Columns;
 }
Пример #2
0
 public void WriteColumns(RPLWriter rplWriter)
 {
     if (rplWriter != null)
     {
         BinaryWriter binaryWriter = rplWriter.BinaryWriter;
         if (binaryWriter != null)
         {
             Stream baseStream = binaryWriter.BaseStream;
             long   position   = baseStream.Position;
             binaryWriter.Write((byte)16);
             binaryWriter.Write(this.m_columnsOffset);
             binaryWriter.Write(this.m_columns.Count);
             foreach (ColumnDetail column in this.m_columns)
             {
                 column.WriteMeasurement(binaryWriter);
             }
             this.m_columnsOffset = baseStream.Position;
             binaryWriter.Write((byte)254);
             binaryWriter.Write(position);
             binaryWriter.Write((byte)255);
         }
         else
         {
             RPLReportSection rPLReportSection = new RPLReportSection(this.m_columns.Count);
             rPLReportSection.ID            = this.m_reportSection.ID;
             rPLReportSection.ColumnCount   = this.m_sectionPageSettings.Columns;
             rPLReportSection.ColumnSpacing = (float)this.m_sectionPageSettings.ColumnSpacing;
             for (int i = 0; i < this.m_columns.Count; i++)
             {
                 rPLReportSection.Columns[i] = this.m_columns[i].WriteMeasurement();
             }
             this.m_rplElement = rPLReportSection;
         }
     }
 }
Пример #3
0
        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();
            }
        }
 public static RectangleF CalculateFooterBounds(RPLReportSection reportSection, RPLPageLayout pageLayout, float top, float width)
 {
     if (reportSection.Footer == null)
     {
         return(RectangleF.Empty);
     }
     return(new RectangleF(pageLayout.MarginLeft, top, width, reportSection.Footer.Height));
 }
        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);
        }
            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;
            }
Пример #8
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);
            }
        }
        public static RectangleF CalculateColumnBounds(RPLReportSection reportSection, RPLPageLayout pageLayout, int columnNumber, float top, float columnHeight)
        {
            float num  = pageLayout.PageWidth - pageLayout.MarginLeft - pageLayout.MarginRight;
            int   num2 = reportSection.ColumnCount;

            if (num2 == 0)
            {
                num2 = 1;
            }
            float num3 = (float)(reportSection.ColumnCount - 1) * reportSection.ColumnSpacing;
            float num4 = (num - num3) / (float)num2;

            return(new RectangleF(pageLayout.MarginLeft + (float)columnNumber * (reportSection.ColumnSpacing + num4), top, num4, columnHeight));
        }
 public void Reset()
 {
     this.m_header           = null;
     this.m_footer           = null;
     this.m_rplReportSection = null;
     this.m_bodyOffset       = 0L;
     this.m_offset           = 0L;
     this.m_itemRenderSizes  = null;
     this.m_sectionIndex     = -1;
     this.m_bodyHelper       = null;
     this.m_itemsOnPage      = 0;
     if (this.Done)
     {
         this.m_body = null;
     }
 }
Пример #11
0
 internal void Reset()
 {
     m_header           = null;
     m_footer           = null;
     m_rplReportSection = null;
     m_bodyOffset       = 0L;
     m_offset           = 0L;
     m_itemRenderSizes  = null;
     m_sectionIndex     = -1;
     m_bodyHelper       = null;
     m_itemsOnPage      = 0;
     if (Done)
     {
         m_body = null;
     }
 }
        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);
        }
Пример #13
0
        internal RenderingReportSection(GdiContext context, RPLReportSection reportSection, RPLSizes sectionSize, int index, float width, float offsetTop)
        {
            m_position.Y      = offsetTop;
            m_position.X      = sectionSize.Left;
            m_position.Width  = width;
            m_position.Height = sectionSize.Height;
            string str = index.ToString(CultureInfo.InvariantCulture);

            m_accessibleName = "ReportSection" + str;
            RectangleF empty = RectangleF.Empty;

            if (reportSection.Header != null)
            {
                empty = new RectangleF(reportSection.Header.Left, reportSection.Header.Top + offsetTop, width, reportSection.Header.Height);
                reportSection.Header.Width = width;
                reportSection.Header.Element.ElementProps.UniqueName = "ReportSection" + str + "Header";
                m_header = new RenderingHeader();
                m_header.Initialize(context, reportSection.Header, empty, ReportPreviewStrings.ReportItemAccessibleNameHeader);
                m_header.SetWidth(width);
                offsetTop += reportSection.Header.Height;
            }
            RPLItemMeasurement rPLItemMeasurement = reportSection.Columns[0];

            empty = new RectangleF(rPLItemMeasurement.Left, rPLItemMeasurement.Top + offsetTop, width, rPLItemMeasurement.Height);
            rPLItemMeasurement.Width = width;
            rPLItemMeasurement.Element.ElementProps.UniqueName = "ReportSection" + str + "Body";
            m_body = new RenderingBody();
            m_body.Initialize(context, rPLItemMeasurement, empty, ReportPreviewStrings.ReportItemAccessibleNameBody);
            m_body.SetWidth(width);
            offsetTop += rPLItemMeasurement.Height;
            if (reportSection.Footer != null)
            {
                empty = new RectangleF(reportSection.Footer.Left, reportSection.Footer.Top + offsetTop, width, reportSection.Footer.Height);
                reportSection.Footer.Width = width;
                reportSection.Footer.Element.ElementProps.UniqueName = "Section" + str + "Footer";
                m_footer = new RenderingFooter();
                m_footer.Initialize(context, reportSection.Footer, empty, ReportPreviewStrings.ReportItemAccessibleNameFooter);
                m_footer.SetWidth(width);
                offsetTop += reportSection.Footer.Height;
            }
        }
Пример #14
0
        internal void WriteColumns(RPLWriter rplWriter)
        {
            if (rplWriter == null)
            {
                return;
            }
            BinaryWriter binaryWriter = rplWriter.BinaryWriter;

            if (binaryWriter != null)
            {
                Stream baseStream = binaryWriter.BaseStream;
                long   position   = baseStream.Position;
                binaryWriter.Write((byte)16);
                binaryWriter.Write(m_columnsOffset);
                binaryWriter.Write(m_columns.Count);
                foreach (ColumnDetail column in m_columns)
                {
                    column.WriteMeasurement(binaryWriter);
                }
                m_columnsOffset = baseStream.Position;
                binaryWriter.Write((byte)254);
                binaryWriter.Write(position);
                binaryWriter.Write(byte.MaxValue);
            }
            else
            {
                RPLReportSection rPLReportSection = new RPLReportSection(m_columns.Count);
                rPLReportSection.ID            = m_reportSection.ID;
                rPLReportSection.ColumnCount   = m_sectionPageSettings.Columns;
                rPLReportSection.ColumnSpacing = (float)m_sectionPageSettings.ColumnSpacing;
                for (int i = 0; i < m_columns.Count; i++)
                {
                    rPLReportSection.Columns[i] = m_columns[i].WriteMeasurement();
                }
                m_rplElement = rPLReportSection;
            }
        }
Пример #15
0
 public SectionEntry(RPLReportSection section)
 {
     SectionId         = section.ID;
     HeaderMeasurement = section.Header;
     FooterMeasurement = section.Footer;
 }
        private SectionEntry RenderHeaderFooters(RPLReportSection section, bool firstSection, ref bool pageCached, List <RPLReport> rplReportCache, ref RPLHeaderFooter footer, ref bool hasHeaderSoFar, ref bool hasFooterSoFar)
        {
            SectionEntry result = new SectionEntry(section);

            if (section.Footer != null)
            {
                footer = (section.Footer.Element as RPLHeaderFooter);
                if (footer.Children != null && footer.Children.Length != 0)
                {
                    hasFooterSoFar = true;
                }
            }
            if (section.Header != null)
            {
                RPLHeaderFooter rPLHeaderFooter = section.Header.Element as RPLHeaderFooter;
                if (rPLHeaderFooter.Children != null && rPLHeaderFooter.Children.Length != 0)
                {
                    hasHeaderSoFar = true;
                }
            }
            CachePage(ref pageCached, rplReportCache);
            m_inHeaderFooter = true;
            if (firstSection)
            {
                m_needsToResetTextboxes = true;
            }
            RPLItemMeasurement header = section.Header;

            if (hasHeaderSoFar)
            {
                m_writer.StartHeader();
                if (header != null)
                {
                    RenderRectangle((RPLContainer)header.Element, 0f, canGrow: true, header, new BorderContext(), inTablix: false, ignoreStyles: true);
                }
                m_writer.FinishHeader();
            }
            RPLItemMeasurement footer2 = section.Footer;

            if (hasFooterSoFar)
            {
                m_writer.StartFooter();
                if (footer2 != null)
                {
                    RenderRectangle((RPLContainer)footer2.Element, 0f, canGrow: true, footer2, new BorderContext(), inTablix: false, ignoreStyles: true);
                }
                m_writer.FinishFooter();
            }
            if (firstSection)
            {
                bool flag  = header != null;
                bool flag2 = flag && !(header.Element.ElementPropsDef as RPLHeaderFooterPropsDef).PrintOnFirstPage;
                bool flag3 = footer2 != null;
                bool flag4 = flag3 && !(footer2.Element.ElementPropsDef as RPLHeaderFooterPropsDef).PrintOnFirstPage;
                if ((flag2 || flag4) && (flag || flag3))
                {
                    if (hasHeaderSoFar)
                    {
                        m_writer.StartHeader(firstPage: true);
                        if (flag && !flag2)
                        {
                            RenderRectangle((RPLContainer)header.Element, 0f, canGrow: true, header, new BorderContext(), inTablix: false, ignoreStyles: true);
                        }
                        m_writer.FinishHeader();
                    }
                    if (hasFooterSoFar)
                    {
                        m_writer.StartFooter(firstPage: true);
                        if (flag3 && !flag4)
                        {
                            RenderRectangle((RPLContainer)footer2.Element, 0f, canGrow: true, footer2, new BorderContext(), inTablix: false, ignoreStyles: true);
                        }
                        m_writer.FinishFooter();
                    }
                    m_writer.HasTitlePage = true;
                }
                m_needsToResetTextboxes = false;
            }
            m_inHeaderFooter = false;
            return(result);
        }
Пример #17
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();
        }
        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);
        }
Пример #19
0
 public override RectangleF CalculateColumnBounds(RPLReportSection reportSection, RPLPageLayout pageLayout, RPLItemMeasurement column, int columnNumber, float top, float columnHeight, float columnWidth)
 {
     return(HardPageBreakShared.CalculateColumnBounds(reportSection, pageLayout, columnNumber, top, columnHeight));
 }
Пример #20
0
 public override RectangleF CalculateFooterBounds(RPLReportSection section, RPLPageLayout pageLayout, float top, float width)
 {
     return(HardPageBreakShared.CalculateFooterBounds(section, pageLayout, top, width));
 }
Пример #21
0
        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);
        }
Пример #22
0
 public SectionEntry(RPLReportSection section)
 {
     this.SectionId         = section.ID;
     this.HeaderMeasurement = section.Header;
     this.FooterMeasurement = section.Footer;
 }
Пример #23
0
 public virtual RectangleF CalculateFooterBounds(RPLReportSection section, RPLPageLayout pageLayout, float top, float width)
 {
     return(RectangleF.Empty);
 }
Пример #24
0
 public virtual RectangleF CalculateColumnBounds(RPLReportSection section, RPLPageLayout pageLayout, RPLItemMeasurement column, int columnNumber, float top, float columnHeight, float columnWidth)
 {
     return(RectangleF.Empty);
 }