Print(Printer: IGxDocumentPrinter; SectionIndex: Integer; RangeIndex: Integer; Pages: String);
Printer. Printer that prints the document.
SectionIndex. The number of the section that is necessary to print (-1 if it is necessary to print all sections of the document).
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 the Pages option the pages are specified in the following way:
"3". Selected page print.
"1,3". Selected pages print.
"1-3". Print selected pages range.
"". Print all pages.
Sub Main;
Var
MB: IMetabase;
Printer: IGxPrinter;
DocPrint: IGxDocumentPrinter;
Docum: IGxDocument;
Begin
MB:=MetabaseClass.Active;
Printer:=GxPrinters.DefaultPrinter;
DocPrint:=Printer As IGxDocumentPrinter;
Docum:=MB.ItemById("Report").Bind As IGxDocument;
Docum.Print(DocPrint,1,0,"1");
End Sub Main;
After executing the example the first page from the first section is printed on a default operating system printer. A data source of the document is a regular report with the Report identifier.
See also: