PagePrintableRect(PageNumber: Integer): IGxRect;
PageNumber - number of the page for which you need to get printed range. Page numbering starts with one.
The PagePrintableRect property returns cell range that is to be printed on the specified page.
This property returns a rectangle, the borders of which contain coordinates of the top left and bottom right cells in the printed range.
Executing the example requires that the repository contains a regular report with the identifier Report_1.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
Sheets: IPrxSheets;
Tab: IPrxTable;
TSheet: ITabSheet;
TabPrint: ITabSheetPrinter;
PrintRange: IGxRect;
PageNum: Integer;
Begin
MB := MetabaseClass.Active;
Rep := MB.ItemById("Report_1").Bind As IPrxReport;
Sheets := Rep.Sheets;
For Each Tab In Sheets Do
TabPrint := Tab.CreatePrinter;
Debug.WriteLine("Sheet: " + (Tab As IPrxSheet).Name +
"; Number of pages: " + TabPrint.GetPageCount.ToString);
TSheet := Tab.TabSheet;
Debug.Indent;
For PageNum := 1 To TabPrint.GetPageCount Do
PrintRange := TabPrint.PagePrintableRect(PageNum);
Debug.WriteLine("Page: " + PageNum.ToString +
"; Printed cell range:" +
TSheet.Cells(PrintRange.Top, PrintRange.Left, PrintRange.Bottom, PrintRange.Right).Address);
End For;
Debug.Unindent;
End For;
End Sub UserProc;
After executing this example the development environment console displays the list of regular report sheets. For each sheet there is specified the number of pages in which it is divided when printed. Printed cell range is displayed for each page.
See also: