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);
        }
        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);
        }
Exemplo n.º 3
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;
            }
Exemplo n.º 5
0
        public RPLPageLayout WritePageLayout(RPLWriter rplWriter, PageContext pageContext)
        {
            RPLPageLayout     rPLPageLayout     = new RPLPageLayout();
            ReportSectionPage reportSectionPage = new ReportSectionPage(this.m_reportSection.Page);

            reportSectionPage.PageLayout = rPLPageLayout;
            rPLPageLayout.PageHeight     = (float)pageContext.Common.Pagination.PhysicalPageHeight;
            rPLPageLayout.PageWidth      = (float)pageContext.Common.Pagination.PhysicalPageWidth;
            rPLPageLayout.MarginBottom   = (float)pageContext.Common.Pagination.MarginBottom;
            rPLPageLayout.MarginLeft     = (float)pageContext.Common.Pagination.MarginLeft;
            rPLPageLayout.MarginRight    = (float)pageContext.Common.Pagination.MarginRight;
            rPLPageLayout.MarginTop      = (float)pageContext.Common.Pagination.MarginTop;
            reportSectionPage.WriteItemStyle(rplWriter, pageContext);
            return(rPLPageLayout);
        }
        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);
        }
Exemplo n.º 7
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 void WriteItemStyle(RPLWriter rplWriter, PageContext pageContext)
        {
            if (rplWriter == null)
            {
                return;
            }
            Style style = m_source.Style;

            if (style == null)
            {
                return;
            }
            BinaryWriter binaryWriter = rplWriter.BinaryWriter;

            if (binaryWriter != null)
            {
                WriteSharedStyle(binaryWriter, style, pageContext);
                StyleInstance style2 = m_source.Instance.Style;
                if (style2 != null)
                {
                    WriteNonSharedStyleWithoutTag(binaryWriter, style, style2, pageContext);
                }
                binaryWriter.Write(byte.MaxValue);
                return;
            }
            RPLPageLayout pageLayout = m_pageLayout;

            if (pageLayout != null)
            {
                RPLStyleProps rPLStyleProps  = WriteSharedStyle(style, pageContext);
                RPLStyleProps rPLStyleProps2 = null;
                StyleInstance style3         = m_source.Instance.Style;
                if (style3 != null)
                {
                    rPLStyleProps2 = WriteNonSharedStyle(style, style3, pageContext);
                }
                if (rPLStyleProps != null || rPLStyleProps2 != null)
                {
                    pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
                }
            }
        }
Exemplo n.º 9
0
 private void WriteReportPageLayoutAtStart(RPLWriter rplWriter)
 {
     if (this.m_pageContext.VersionPicker != 0 && this.m_pageContext.VersionPicker != RPLVersionEnum.RPL2008WithImageConsolidation && rplWriter != null)
     {
         BinaryWriter binaryWriter = rplWriter.BinaryWriter;
         Page         page         = ((ReportElementCollectionBase <AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection>) this.m_report.ReportSections)[0].Page;
         if (binaryWriter != null)
         {
             Stream baseStream = binaryWriter.BaseStream;
             this.m_pageLayoutOffset = baseStream.Position;
             binaryWriter.Write((byte)3);
             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());
             ReportPageLayout reportPageLayout = new ReportPageLayout(page);
             reportPageLayout.WriteElementStyle(rplWriter, this.m_pageContext);
             binaryWriter.Write((byte)255);
         }
         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();
             ReportPageLayout reportPageLayout2 = new ReportPageLayout(page);
             reportPageLayout2.WriteElementStyle(rplWriter, this.m_pageContext);
         }
     }
 }
 public void WriteItemStyle(RPLWriter rplWriter, PageContext pageContext)
 {
     if (rplWriter != null)
     {
         Style style = this.m_source.Style;
         if (style != null)
         {
             BinaryWriter binaryWriter = rplWriter.BinaryWriter;
             if (binaryWriter != null)
             {
                 base.WriteSharedStyle(binaryWriter, style, pageContext);
                 StyleInstance style2 = this.m_source.Instance.Style;
                 if (style2 != null)
                 {
                     this.WriteNonSharedStyleWithoutTag(binaryWriter, style, style2, pageContext);
                 }
                 binaryWriter.Write((byte)255);
             }
             else
             {
                 RPLPageLayout pageLayout = this.m_pageLayout;
                 if (pageLayout != null)
                 {
                     RPLStyleProps rPLStyleProps  = base.WriteSharedStyle(style, pageContext);
                     RPLStyleProps rPLStyleProps2 = null;
                     StyleInstance style3         = this.m_source.Instance.Style;
                     if (style3 != null)
                     {
                         rPLStyleProps2 = this.WriteNonSharedStyle(style, style3, pageContext);
                     }
                     if (rPLStyleProps == null && rPLStyleProps2 == null)
                     {
                         return;
                     }
                     pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
                 }
             }
         }
     }
 }
Exemplo n.º 11
0
 private void WriteReportPageLayoutAtStart(RPLWriter rplWriter)
 {
     if (m_pageContext.VersionPicker != 0 && m_pageContext.VersionPicker != RPLVersionEnum.RPL2008WithImageConsolidation && rplWriter != null)
     {
         BinaryWriter binaryWriter = rplWriter.BinaryWriter;
         Page         page         = m_report.ReportSections[0].Page;
         if (binaryWriter != null)
         {
             Stream baseStream = binaryWriter.BaseStream;
             m_pageLayoutOffset = baseStream.Position;
             binaryWriter.Write((byte)3);
             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());
             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);
         }
     }
 }
Exemplo n.º 12
0
        internal void WriteElementStyle(RPLWriter rplWriter, PageContext pageContext)
        {
            if (rplWriter == null)
            {
                return;
            }
            Style style = m_source.Style;

            if (style == null)
            {
                return;
            }
            BinaryWriter binaryWriter = rplWriter.BinaryWriter;

            if (binaryWriter != null)
            {
                WriteSharedStyle(binaryWriter, style, pageContext, 6);
                StyleInstance styleInstance = GetStyleInstance(m_source, null);
                if (styleInstance != null)
                {
                    WriteNonSharedStyle(binaryWriter, style, styleInstance, pageContext, null, null);
                }
                binaryWriter.Write(byte.MaxValue);
                return;
            }
            RPLPageLayout pageLayout     = rplWriter.Report.RPLPaginatedPages[0].PageLayout;
            RPLStyleProps rPLStyleProps  = WriteSharedStyle(style, pageContext);
            RPLStyleProps rPLStyleProps2 = null;
            StyleInstance styleInstance2 = GetStyleInstance(m_source, null);

            if (styleInstance2 != null)
            {
                rPLStyleProps2 = WriteNonSharedStyle(style, styleInstance2, pageContext, null);
            }
            if (rPLStyleProps != null || rPLStyleProps2 != null)
            {
                pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
            }
        }
 public void WriteElementStyle(RPLWriter rplWriter, PageContext pageContext)
 {
     if (rplWriter != null)
     {
         Style style = base.m_source.Style;
         if (style != null)
         {
             BinaryWriter binaryWriter = rplWriter.BinaryWriter;
             if (binaryWriter != null)
             {
                 this.WriteSharedStyle(binaryWriter, style, pageContext, 6);
                 StyleInstance styleInstance = base.GetStyleInstance(base.m_source, null);
                 if (styleInstance != null)
                 {
                     this.WriteNonSharedStyle(binaryWriter, style, styleInstance, pageContext, null, null);
                 }
                 binaryWriter.Write((byte)255);
             }
             else
             {
                 RPLPageLayout pageLayout     = rplWriter.Report.RPLPaginatedPages[0].PageLayout;
                 RPLStyleProps rPLStyleProps  = this.WriteSharedStyle(style, pageContext);
                 RPLStyleProps rPLStyleProps2 = null;
                 StyleInstance styleInstance2 = base.GetStyleInstance(base.m_source, null);
                 if (styleInstance2 != null)
                 {
                     rPLStyleProps2 = this.WriteNonSharedStyle(style, styleInstance2, pageContext, null);
                 }
                 if (rPLStyleProps == null && rPLStyleProps2 == null)
                 {
                     return;
                 }
                 pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
             }
         }
     }
 }
        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);
        }
Exemplo n.º 15
0
        internal void RenderStrings(RPLReport report, IExcelGenerator excel, out string left, out string center, out string right)
        {
            foreach (ReportItemInfo full in m_fullList)
            {
                RPLPageLayout rPLPageLayout = full.RPLSource as RPLPageLayout;
                if (rPLPageLayout != null)
                {
                    continue;
                }
                RPLTextBox   rPLTextBox = full.RPLSource as RPLTextBox;
                RPLItemProps rPLItemProps;
                byte         elementType;
                if (rPLTextBox != null)
                {
                    if (rPLTextBox.StartOffset > 0)
                    {
                        rPLItemProps = m_report.GetItemProps(rPLTextBox.StartOffset, out elementType);
                    }
                    else
                    {
                        rPLItemProps = (RPLItemProps)rPLTextBox.ElementProps;
                        elementType  = 7;
                    }
                }
                else
                {
                    rPLItemProps = m_report.GetItemProps(full.RPLSource, out elementType);
                }
                if (elementType == 7)
                {
                    full.Values = (RPLTextBoxProps)rPLItemProps;
                    RPLElementStyle     style = rPLItemProps.Style;
                    HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left;
                    object obj = style[25];
                    if (obj != null)
                    {
                        horizontalAlignment = LayoutConvert.ToHorizontalAlignEnum((RPLFormat.TextAlignments)obj);
                    }
                    int    num   = 0;
                    int    num2  = 0;
                    string text  = (string)rPLItemProps.Style[15];
                    string text2 = (string)rPLItemProps.Style[16];
                    if (text != null)
                    {
                        num = LayoutConvert.ConvertMMTo20thPoints(LayoutConvert.ToMillimeters(text));
                    }
                    if (text2 != null)
                    {
                        num2 = LayoutConvert.ConvertMMTo20thPoints(LayoutConvert.ToMillimeters(text2));
                    }
                    switch (horizontalAlignment)
                    {
                    case HorizontalAlignment.Left:
                        full.AlignmentPoint = full.Left + num;
                        break;

                    case HorizontalAlignment.Right:
                        full.AlignmentPoint = full.Right - num2;
                        break;

                    default:
                        full.AlignmentPoint = full.Left + (full.Right - full.Left + num - num2) / 2;
                        break;
                    }
                    if (full.AlignmentPoint < m_centerWidth)
                    {
                        m_leftList.Add(full);
                    }
                    else if (full.AlignmentPoint < m_rightWidth)
                    {
                        m_centerList.Add(full);
                    }
                    else
                    {
                        m_rightList.Add(full);
                    }
                }
            }
            m_leftList.Sort(ReportItemInfo.CompareTopsThenLefts);
            m_centerList.Sort(ReportItemInfo.CompareTopsThenLefts);
            m_rightList.Sort(ReportItemInfo.CompareTopsThenLefts);
            left   = RenderString(m_leftList, excel);
            center = RenderString(m_centerList, excel);
            right  = RenderString(m_rightList, excel);
        }
 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));
 }
        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));
        }
Exemplo n.º 18
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));
 }
Exemplo n.º 19
0
 private void WriteReportPageLayout2008(RPLWriter rplWriter, double bodyWidth, double bodyHeight)
 {
     if (rplWriter != null)
     {
         BinaryWriter binaryWriter = rplWriter.BinaryWriter;
         AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection = ((ReportElementCollectionBase <AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection>) this.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(this.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(this.m_bodyOffset);
             this.m_columnsOffset = baseStream.Position;
             binaryWriter.Write((byte)254);
             binaryWriter.Write(position);
             binaryWriter.Write((byte)255);
             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());
             ReportPageLayout reportPageLayout = new ReportPageLayout(page);
             reportPageLayout.WriteElementStyle(rplWriter, this.m_pageContext);
             binaryWriter.Write((byte)255);
         }
         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();
             ReportPageLayout reportPageLayout2 = new ReportPageLayout(page);
             reportPageLayout2.WriteElementStyle(rplWriter, this.m_pageContext);
         }
     }
 }
Exemplo n.º 20
0
 public override RectangleF CalculateFooterBounds(RPLReportSection section, RPLPageLayout pageLayout, float top, float width)
 {
     return(HardPageBreakShared.CalculateFooterBounds(section, pageLayout, top, width));
 }
Exemplo n.º 21
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();
        }
Exemplo n.º 22
0
 public virtual RectangleF CalculateFooterBounds(RPLReportSection section, RPLPageLayout pageLayout, float top, float width)
 {
     return(RectangleF.Empty);
 }
Exemplo n.º 23
0
 public virtual RectangleF CalculateColumnBounds(RPLReportSection section, RPLPageLayout pageLayout, RPLItemMeasurement column, int columnNumber, float top, float columnHeight, float columnWidth)
 {
     return(RectangleF.Empty);
 }
Exemplo n.º 24
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);
        }