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. Titles and parameters of report headers and footers are 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 + "; Number of pages: " + 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 will be divided when printed is displayed for each sheet.
See also: