Try OpenEdge Now
skip to main content
Managing ABL Applications
ABL and R-code Deployment and Management : Managing Print Devices : Printing in OpenEdge : OUTPUT TO statement
 
OUTPUT TO statement
By default, all OpenEdge output is directed to the terminal. The OUTPUT TO statement allows an application to redirect output to other output devices. The following is a partial syntax example of the OUTPUT TO statement:
Syntax
OUTPUT [ STREAM stream | STREAM-HANDLE handle ] TO
{ PRINTER [ printer-name ]| opsys-file
| opsys-device
| TERMINAL
| VALUE ( expression )
| "CLIPBOARD"
}
.
.
.

[ PAGED ][ PAGE-SIZE { constant | VALUE ( expression ) }]
.
.
.
Use the OUTPUT TO statement with the PRINTER option to send output to the default print device on the current operating system. For example:
OUTPUT TO PRINTER.
On UNIX, the OUTPUT TO PRINTER statement sends output to the default spooler. To use a spooler other than the default, start OpenEdge using the Printer (-o) startup parameter.
In Windows, the OUTPUT TO PRINTER statement sends output to the printer defined in default print context. The default print context is the set of values that defines the default printer and setup for that printer in Windows. If there is no default print context, OpenEdge uses the printer control settings from the current environment.
Use the SYSTEM-DIALOG PRINTER-SETUP statement to display the Windows Print dialog box and let the user change the default print context at runtime. Use the PRINTER-NAME attribute of the SESSION system handle to change the printer name in the default print context without user intervention. You can change the system default printer from the Windows Control Panel.
Use the OUTPUT TO PRINTER statement with its various options to override the default print context for a specific print job. For example, send output to a printer other than the default printer by using the following syntax:
OUTPUT [ STREAM stream | STREAM-HANDLE handle ] TO PRINTER printer-name
OpenEdge assumes that all printers can handle hard-coded form feed characters (CTRL+L or 0C Hex). The OUTPUT TO PRINTER statement automatically paginates OpenEdge output on the default printer. To paginate output on a printer, other than the default printer, use the OUTPUT TO PRINTER statement with the PAGED or PAGE-SIZE option.
Use the Printer (-o) startup parameter to specify a default printer to use when processing the OUTPUT TO PRINTER statement in procedures. The specified printer must be set up on the current operating system.
For a complete description of the OUTPUT TO PRINTER statement, the SYSTEM-DIALOG PRINTER-SETUP statement, and the SESSION system handle, see OpenEdge Development: ABL Reference. For more information about the Printer (-o) startup parameter, see OpenEdge Deployment: Startup Command and Parameter Reference. For more information about streams, see OpenEdge Development: Programming Interfaces.