Highlighted
Absent Member.
Absent Member.
1138 views

[archive] Selecting a printer

[Migrated content. Thread originally posted on 28 February 2007]

Hello
I am running a procedure called Acu-DWtsRept-Print that is generated by the Report Composer. It prints to my default printer. Is there any way I can choose a printer other than my default printer to print the report?

Thanks:confused:
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Selecting a printer

We give our users a menu option to change their printer when the program loads (and before the print file is generated). This is the code executed by that menu option:-                   CALL "WIN$PRINTER" USING WINPRINT-SETUP
                       GIVING WINPRINT-PRINTER-STATUS
      **** This ensures the printer will print at least 132 columns.
                   MOVE WPRTFONT-COURIER-12-COMP TO WPRTDATA-FONT
                   CALL "WIN$PRINTER" USING WINPRINT-SET-STD-FONT,
                                    WINPRINT-DATA
                           GIVING WINPRINT-PRINTER-STATUS
                   CALL "WIN$PRINTER"
                       USING WINPRINT-GET-PAGE-LAYOUT,
                             WINPRINT-DATA
                       GIVING WINPRINT-PRINTER-STATUS
You need to do this before you open the print file though, otherwise it won't have any effect.

This is "interactive" and the user selects the printer. You can set the printer programmatically without the user doing anything like this:-               MOVE "Your Printer Name"   TO  WINPRINT-NAME
               CALL "WIN$PRINTER" USING WINPRINT-SET-PRINTER-EX,
                                        WINPRINT-SELECTION
                                 GIVING WSSVI-STATUS-CODE


I hope this helps...
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Selecting a printer

It is a good example Blacky, but I believe Milk5600 is using the Acubench print engine, which does not use the WIN$PRINTER settings. Unfortunately.
It might be however, that he can use your example to get the printer name, then pass this as the last parameter to AcuBenchPrintExecWBPrint.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Selecting a printer

Thanks, guys
When using win$printer how do you return the selected printer's name?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Selecting a printer

Hello Again
The following code allows me to select a printer and pass the name to the Report-Composer generated routine:

CALL "WIN$PRINTER" USING WINPRINT-SETUP
GIVING WINPRINT-PRINTER-STATUS
CALL "WIN$PRINTER"
USING WINPRINT-GET-current-info,
WINPRINT-selection
GIVING WINPRINT-PRINTER-STATUS
Move WINPRINT-Name To Acu-Printer-Name

Thanks again for your help
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.