Printing¶
It is possible to let the user select a printer via the print dialog, specify a printer, or print to the default printer. The cDRReport class contains two methods to print the report. This paragraph explains how to get a report printed.
User Select a Printer¶
If you want to have the end-user select a printer, you can pass a zero as an argument to the PrintReport message. The system will temporarily create a cPrintDialog object.
Send PrintReport of oReport 0
Default Printer¶
To print to the default printer, send the message PrintToDefaultPrinter to the report object. This method retrieves the Windows default printer by temporarily instantiating an object of the cPrintDialog class. The gathered information will be passed to the PrintReport method.
Send PrintToDefaultPrinter of oReport
or:
Set peOutputDestination of oReport to PRINT_TO_PRINTER_NO_DIALOG
Send OutputReport of oReport
Printing To a Specific Printer¶
You can print to a specific printer without the printer selection dialog appearing. To do this, set the psPrinterName property of the report object and send the message PrintReport, passing a zero as the message argument.
Set psPrinterName of oReport to "OKI 1234"
Set peOutputDestination of oReport to PRINT_TO_PRINTER
Send OutputReport of oReport
Print to Printer Bins¶
There are two options:
- The full report can be printed via a specific bin.
- One or more pages can be printed via a specific bin and others using a different bin.
It is important to know that the standard bins defined by the Windows API are not always supported by all printers. If a printer bin has been selected that is not supported by the used printer (driver), an information message will be presented. If information messages are not displayed, the result will be that the output for the unsupported bin will be printed at the default bin.