/// <summary> /// Build the Pages for this report. /// </summary> /// <returns></returns> public Pages BuildPages() { PageNumber = 1; // reset page numbers TotalPages = 1; var pgs = new Pages(this); pgs.PageHeight = _Report.PageHeight.Points; pgs.PageWidth = _Report.PageWidth.Points; try { var p = new Page(1); // kick it off with a new page pgs.AddPage(p); // Create all the pages _Report.Body.RunPage(pgs); if (pgs.LastPage.IsEmpty() && pgs.PageCount > 1) // get rid of extraneous pages which { pgs.RemoveLastPage(); // can be caused by region page break at end } // Now create the headers and footers for all the pages (as needed) if (_Report.PageHeader != null) { _Report.PageHeader.RunPage(pgs); } if (_Report.PageFooter != null) { _Report.PageFooter.RunPage(pgs); } // clear out any runtime clutter foreach (Page pg in pgs) { pg.ResetPageExpressions(); } pgs.SortPageItems(); // Handle ZIndex ordering of pages } catch (Exception e) { rl.LogError(8, "Exception running report\r\n" + e.Message + "\r\n" + e.StackTrace); } finally { pgs.CleanUp(); // always want to make sure we clean this up since _Cache = new RCache(); } return(pgs); }
internal void RunPage(IPresent ip) { Pages pgs = new Pages(ip.Report()); try { Page p = new Page(1); // kick it off with a new page pgs.AddPage(p); // Create all the pages _Body.RunPage(pgs); if (pgs.LastPage.IsEmpty() && pgs.PageCount > 1) // get rid of extraneous pages which { pgs.RemoveLastPage(); // can be caused by region page break at end } // Now create the headers and footers for all the pages (as needed) if (_PageHeader != null) { _PageHeader.RunPage(pgs); } if (_PageFooter != null) { _PageFooter.RunPage(pgs); } pgs.SortPageItems(); // Handle ZIndex ordering of pages ip.RunPages(pgs); } finally { pgs.CleanUp(); // always want to make sure we clean this up since if (_DataSourcesDefn != null) { _DataSourcesDefn.CleanUp(pgs.Report); // ensure datasets are cleaned up } } return; }
/// <summary> /// RunRenderPdf will render a Pdf given the page structure /// </summary> /// <param name="sg"></param> /// <param name="pgs"></param> public void RunRenderPdf(IStreamGen sg, Pages pgs) { PageNumber = 1; // reset page numbers TotalPages = 1; IPresent ip = new RenderPdf(this, sg); try { ip.Start(); ip.RunPages(pgs); ip.End(); } finally { pgs.CleanUp(); // always want to make sure we cleanup to reduce resource usage _Cache = new RCache(); } return; }
/// <summary> /// RunRenderTif will render a TIF given the page structure /// </summary> /// <param name="sg"></param> /// <param name="pgs"></param> public void RunRenderTif(IStreamGen sg, Pages pgs, bool bColor) { PageNumber = 1; // reset page numbers TotalPages = 1; var ip = new RenderTif(this, sg); ip.RenderColor = bColor; try { ip.Start(); ip.RunPages(pgs); ip.End(); } finally { pgs.CleanUp(); // always want to make sure we cleanup to reduce resource usage _Cache = new RCache(); } return; }
/// <summary> /// Build the Pages for this report. /// </summary> /// <returns></returns> public Pages BuildPages() { PageNumber = 1; // reset page numbers TotalPages = 1; var pgs = new Pages(this); pgs.PageHeight = _Report.PageHeight.Points; pgs.PageWidth = _Report.PageWidth.Points; try { var p = new Page(1); // kick it off with a new page pgs.AddPage(p); // Create all the pages _Report.Body.RunPage(pgs); if (pgs.LastPage.IsEmpty() && pgs.PageCount > 1) // get rid of extraneous pages which pgs.RemoveLastPage(); // can be caused by region page break at end // Now create the headers and footers for all the pages (as needed) if (_Report.PageHeader != null) _Report.PageHeader.RunPage(pgs); if (_Report.PageFooter != null) _Report.PageFooter.RunPage(pgs); // clear out any runtime clutter foreach (Page pg in pgs) pg.ResetPageExpressions(); pgs.SortPageItems(); // Handle ZIndex ordering of pages } catch (Exception e) { rl.LogError(8, "Exception running report\r\n" + e.Message + "\r\n" + e.StackTrace); } finally { pgs.CleanUp(); // always want to make sure we clean this up since _Cache = new RCache(); } return pgs; }
internal void RunPage(IPresent ip) { Pages pgs = new Pages(ip.Report()); try { Page p = new Page(1); // kick it off with a new page pgs.AddPage(p); // Create all the pages _Body.RunPage(pgs); if (pgs.LastPage.IsEmpty()&& pgs.PageCount > 1) // get rid of extraneous pages which pgs.RemoveLastPage(); // can be caused by region page break at end // Now create the headers and footers for all the pages (as needed) if (_PageHeader != null) _PageHeader.RunPage(pgs); if (_PageFooter != null) _PageFooter.RunPage(pgs); pgs.SortPageItems(); // Handle ZIndex ordering of pages ip.RunPages(pgs); } finally { pgs.CleanUp(); // always want to make sure we clean this up since if (_DataSourcesDefn != null) _DataSourcesDefn.CleanUp(pgs.Report); // ensure datasets are cleaned up } return; }