private void CalculateDelayedHeader(RPLWriter rplWriter, ReportSection firstSection, Interactivity interactivity) { firstSection.CalculateDelayedHeader(rplWriter, interactivity); firstSection.UpdateReportSectionSizes(rplWriter); firstSection.WriteEndItemToStream(rplWriter); if (rplWriter != null) { this.m_sectionSizes[0].Height = firstSection.ItemRenderSizes.Height; this.m_sectionSizes[0].Width = firstSection.ItemRenderSizes.Width; this.m_sectionOffsets[0] = firstSection.Offset; } }
public void NextPage(RPLWriter rplWriter, ref ReportSectionHelper lastPageInfo, int page, int totalPages, Interactivity interactivity, bool hasPaginationChunk) { ReportSection reportSection = null; bool flag = true; bool flag2 = false; bool flag3 = false; bool flag4 = (byte)((this.m_sections.Count <= 1) ? 1 : 0) != 0; PageItemHelper pageItemHelper = null; int regionPageNumber = page; int regionTotalPages = totalPages; int num = -1; this.CreateFirstSectionBodyFromPaginationState(page, lastPageInfo, ref pageItemHelper, ref num); if (this.m_pageContext.ImageConsolidation != null) { this.m_pageContext.ImageConsolidation.Reset(); this.m_pageContext.ImageConsolidation.SetName(this.m_report.Name, page); } this.m_pageContext.PageNumber = page; this.m_pageContext.PageTotalInfo.RegisterPageNumberForStart(page); this.m_pageContext.PageTotalInfo.RetrievePageBreakData(page, out regionPageNumber, out regionTotalPages); this.WriteStartItemToStream(rplWriter); this.WriteReportPageLayoutAtStart(rplWriter); for (int i = num; i < this.m_sections.Count; i++) { ReportSection reportSection2 = this.m_sections[i]; bool flag5 = false; bool flag6 = false; bool flag7 = false; if (flag) { reportSection = reportSection2; } if (i == this.m_sections.Count - 1) { flag4 = true; } if (reportSection2.Body == null) { reportSection2.SetContext(); } reportSection2.CalculatePage(rplWriter, page, totalPages, regionPageNumber, regionTotalPages, flag, flag4, interactivity, this.m_pageContext.PageHeight, ref pageItemHelper, ref flag5, ref flag6, ref flag7); if (this.m_pageContext.CancelPage) { this.ResetSectionsOnPage(num, i); return; } if (flag) { flag = false; flag2 = flag5; lastPageInfo = null; } if (flag6) { flag3 = flag6; } this.m_sectionSizes.Add(reportSection2.ItemRenderSizes); this.m_sectionOffsets.Add(reportSection2.Offset); if (this.m_pageContext.PageHeight != 1.7976931348623157E+308) { this.m_pageContext.PageHeight -= reportSection2.Body.ItemPageSizes.Height; } if (flag7) { if (i > this.m_lastSectionIndex) { this.m_lastSectionIndex = i; } reportSection2.SectionIndex = i; break; } } if (this.m_pageContext.TracingEnabled) { if (this.Done) { Report.TracePageBreakIgnoredAtBottom(page, this.m_pageContext.Common.PageBreakInfo); } else if (this.m_pageContext.Common.PageBreakInfo != null) { Report.TraceLogicalPageBreak(page + 1, this.m_pageContext.Common.PageBreakInfo); } else { Report.TraceVerticalPageBreak(page + 1); } } this.m_pageContext.ApplyPageBreak(page); int num2 = 1; double bodyWidth = 0.0; double bodyHeight = 0.0; bool flag8 = flag4 && this.m_sections[this.m_lastSectionIndex].Done; if (this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation) { this.WriteEndReportBodyToRPLStream2008(rplWriter, num, ref bodyWidth, ref bodyHeight); if (rplWriter != null || (interactivity != null && !interactivity.Done && interactivity.NeedPageHeaderFooter)) { this.WriteReportPageLayout2008(rplWriter, bodyWidth, bodyHeight); if (flag3) { this.m_sections[this.m_lastSectionIndex].CalculateDelayedFooter(rplWriter, interactivity); num2++; } if (flag2 && (page == 1 || !flag8 || reportSection.IsHeaderPrintOnLastPage())) { reportSection.CalculateDelayedHeader(rplWriter, interactivity); num2++; } if (rplWriter != null && rplWriter.BinaryWriter != null) { rplWriter.BinaryWriter.Write((byte)255); } } } else if (flag2) { if (!flag8) { this.CalculateDelayedHeader(rplWriter, reportSection, interactivity); } else { reportSection.WriteEndItemToStream(rplWriter); if (rplWriter != null) { this.m_sectionSizes[0].Height = reportSection.ItemRenderSizes.Height; this.m_sectionSizes[0].Width = reportSection.ItemRenderSizes.Width; this.m_sectionOffsets[0] = reportSection.Offset; } } } if (interactivity != null) { interactivity.RegisterDocMapRootLabel(this.m_report.Instance.UniqueName, this.m_pageContext); } if (this.m_pageContext.ImageConsolidation != null) { this.m_pageContext.ImageConsolidation.RenderToStream(); } string pageName = this.m_pageContext.PageTotalInfo.GetPageName(page); this.WriteEndItemToStream(rplWriter, num, num2, reportSection.Header, this.m_sections[this.m_lastSectionIndex].Footer, bodyWidth, bodyHeight, pageName); this.m_pageContext.PageHeight = this.m_pageContext.OriginalPageHeight; if (hasPaginationChunk) { this.ReleaseResourcesOnPage(rplWriter, num, false); } else { this.ReleaseResourcesOnPage(rplWriter, num, true); } }