CreatePrinter: ITabSheetPrinter;
CreatePrinter: Prognoz.Platform.Interop.Tab.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. Captions as well as parameters of report 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.
Executing the example requires that the repository contains a regular report with the Report_1 identifier.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Rep: IPrxReport;
Sheets: IPrxSheets;
Tab: IPrxTable;
TabPrint: ITabSheetPrinter;
Begin
MB := Params.Metabase;
Rep := MB.ItemById["Report_1"].Bind() As IPrxReport;
Sheets := Rep.Sheets;
For Each Tab In Sheets Do
TabPrint := Tab.CreatePrinter();
System.Diagnostics.Debug.WriteLine("Sheet: " + (Tab As IPrxSheet).Name +
"; Pages count: " + TabPrint.GetPageCount().ToString());
End For;
End Sub;
This procedure is an entry point for a .NET assembly. 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: