Print(Printer: IGxDocumentPrinter; SectionIndex: Integer; RangeIndex: Integer; Pages: String);
Printer. The printer that prints the document.
SectionIndex. The number of the section to be printed (-1 if all document sections should be printed).
RangeIndex. The print range number (0 - the entire document; 1 - the current page; 2 - the selected range).
Pages. Pages in the section that are necessary to print.
The Print method prints to a printer in accordance with the specified print options.
In regular report a separate sheet is regarded as a section, in express report and workspace the entire document is regarded as a section.
In the Pages option the pages are specified as follows:
"3". Selected page print.
"1,3". Selected pages print.
"1-3". Print selected pages range.
"". Print all pages.
Executing the example requires that the repository contains a regular report with the REPORT identifier.
Sub UserProc;
Var
MB: IMetabase;
Printer: IGxPrinter;
DocPrint: IGxDocumentPrinter;
Document: IGxDocument;
Begin
MB := MetabaseClass.Active;
Printer := GxPrinters.DefaultPrinter;
DocPrint := Printer As IGxDocumentPrinter;
Document := MB.ItemById("REPORT").Bind As IGxDocument;
Document.Print(DocPrint, 1, 0, "1");
End Sub UserProc;
After executing the example the first page from the first section is printed on a default operating system printer.
See also: