Progress
Programming
Handbook
A Printing Solution
The Progress ADE toolset provides a portable solution for printing text files. The solution is a procedure called
_osprint.p
and it is located in theadecomm
directory in the Progress product directory (DLC
). You can also access the source code for this procedure in thesrc/adecomm
directory located in the Progress product directory.The
_osprint.p
procedure sends a specified text file to the default printer as paged output. Input parameters for the procedure allow you to specify values that configure a print job. On Windows, you can also direct the_osprint.p
procedure to display the Print dialog box and print the text in a specified font. Use the following syntax to call the_osprint.p
procedure from a Progress procedure:
The parameters of the
_osprint.p
procedure are as follows:INPUT parentWindow
A window handle identifying the parent window for Print dialog box and any print status messages on Windows. The procedure ignores a value specified for this parameter in character interfaces. If you specify the unknown value (?) or an invalid handle on Windows, the procedure uses the CURRENT–WINDOW handle.
INPUT printFile
A string value representing the name of a text file to print. You can specify an absolute or relative path for the file. The
_osprint.p
procedure uses thePROPATH
to locate the file.
INPUT
fontNumberAn integer value representing an entry in the font table maintained by the FONT–TABLE handle. The
_osprint.p
procedure uses the specified font to print the text file on Windows. The procedure ignores a value specified for this parameter in character interfaces. If you specify the unknown value (?) or an integer value that does not exist in the font table for Windows, the procedure uses the default system font to print the text file.
INPUT
PrintFlagsAn integer value that determines which printing options are used for a print job on Windows (only). You can use the values in Table 7–1. If you need to use more than one option, add the values of the options together. In all cases, the
_osprint.p
procedure sets the value of the PRINTER–CONTROL–HANDLE attribute of the SESSION handle to zero (0).
INPUT
pageSizeAn integer value representing the number of lines per page. If you specify zero (0) for this parameter, the printer determines the page size. Windows ignores this parameter and calculates the page size based on the Paper Size setting in the Print Setup dialog box and the font specified with the fontNumber parameter.
NOTE: The maximum number of character per line is 255.
INPUT
pageCountAn integer value that determines if
_osprint.p
prints the entire text file or a range of pages from the text file on Windows. The procedure ignores a value specified for this parameter in character interfaces. If the value of this parameter is not zero (0) on Windows, Progress uses the page range specified for the current print context.
OUTPUT result
A logical value that reports the success or failure of the print job.
To call the
_osprint.p
procedure from a Progress procedure, you must define a variable for the result output parameter. Here is an example:_osprint.p
The following list describes the important elements of the previous example:
For more information on the language elements referenced in this section, see the Progress Language Reference .
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |