void CompilePreviewPagesEx(System.Drawing.Printing.PrintPageEventArgs e) { Application.DoEvents(); float height = e.MarginBounds.Height / document.PageHeight; float leftMargin = e.MarginBounds.Left; float topMargin = e.MarginBounds.Top; float yPos = topMargin; Font printFont = FontProvider.GetFont(document.Cpi); ClassicReportPage page = document[fromPage]; for (int rowIndex = 0; rowIndex < document.PageHeight; rowIndex++) { string rowString = page.ToString(rowIndex); rowString = rowString.Replace(' ', 'M'); foreach (ClassicReportPageItem item in page.GetItems(rowIndex)) { float xPos = leftMargin; if (item.Offset > 0) { string trailer = rowString.Substring(0, item.Offset - 1); xPos += e.Graphics.MeasureString(trailer, printFont).Width; } FontStyle fontStyle = FontStyle.Regular; if (item.IsBold) { fontStyle |= FontStyle.Bold; } if (item.IsItalic) { fontStyle |= FontStyle.Italic; } if (item.IsUnderline) { fontStyle |= FontStyle.Underline; } Font itemFont = new Font(printFont, fontStyle); e.Graphics.DrawString(item.Value, itemFont, Brushes.Black, xPos, yPos); itemFont.Dispose(); } yPos += height; } e.HasMorePages = ++fromPage <= toPage; printFont.Dispose(); }
public void Parse(ClassicReportPage page) { StringBuilder sb = new StringBuilder(); if (_text == "%PageEx") { sb.AppendFormat("Page {0} of {1}", page.PageNo, page.Document.Count); } else if (_text == "%Page") { sb.AppendFormat("Page {0}", page.PageNo); } else { sb.Append(_text); } _value = sb.ToString(); _offset = GetOffset(page.Document.PageWidth); }
internal ClassicReportPage NewPage() { _page = new ClassicReportPage(this); // store new page reference _pages.Add(_page); // add the page to our list return _page; }
public ClassicReportPageItem(ClassicReportPage page) { _page = page; _row = page.CurrentRow; }
public void Parse(ClassicReportPage page) { StringBuilder sb = new StringBuilder(); if (_text == "%PageEx") { sb.AppendFormat("Page {0} of {1}",page.PageNo, page.Document.Count); } else if (_text == "%Page") { sb.AppendFormat("Page {0}",page.PageNo); } else { sb.Append(_text); } _value = sb.ToString(); _offset = GetOffset(page.Document.PageWidth); }
internal ClassicReportPage NewPage() { _page = new ClassicReportPage(this); // store new page reference _pages.Add(_page); // add the page to our list return(_page); }
void NewPage() { _page = _document.NewPage(); RenderPageHeaderSection(); }