CreatePrinter: ITabSheetPrinter;
The CreatePrinter method creates an object that enables the user to work with a report sheet prepared for print.
When this method is called each sheet is divided into pages in accordance with the settings specified in the IPrxSheet.PageSettings property. The titles and parameters of report sheet headers and footers are also taken into account.
Executing the example requires that the repository contains a regular report with the Report_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
Sheets: IPrxSheets;
Tab: IPrxTable;
TabPrint: ITabSheetPrinter;
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 +
"; Pages count: " + TabPrint.GetPageCount.ToString);
End For;
End Sub UserProc;
After executing the example the development environment console displays the list of regular report sheets. The number of pages, into which the sheet is to be divided when printed is displayed for each sheet.
See also: