Skip to main content

[archive] Selecting a printer

  • March 1, 2007
  • 4 replies
  • 0 views

[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:

4 replies

[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:
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...

[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:
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.

[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:
Thanks, guys
When using win$printer how do you return the selected printer's name?

[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:
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