cancel
Showing results for 
Search instead for 
Did you mean: 

PowerBuilder Network Printer

Former Member
0 Kudos

I need to print to a printer on the network. I added the printer (COWORKERDSKTP) to my printers on my PC - it is not set as the default.

I went to notepad and was able to print a sample to this printer.

Sample Code:

String ls_printer

ls_printer = 'HP LaserJet 1022 on COWORKERDSKTP'

ls_ret = dw_print.modify(datawindow.print.printername = "' + ls_printer +"'")

//ls_ret returns "" appears OK

ls_ret = dw_print.describe("datawindow.printer.printername")

//ls_ret returns "!"

If I add this here:

ls_ret = dw_print.Describe("Datawindow.Printer")

//ls_ret = EPSON WF-2650 - this is my locally connected default printer

dw_print() will print to the EPSON

I just can't seem to get the syntax to print to the network printer.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rob;

1) You can always let the user choose by calling the PrintSetup ( ) method.

2) For targeting the print output, I would recommend using the PrintGetPrinter () and PrintSetPrinter () methods. The 1st command to get the current default printer and the 2nd command to direct the print output. Once everything is printed, you can again use the PrintSetPrinter () method to restore the previous default printer.

Tip: You can use the PrintGetPrinters () method to get a list of all the user's printers assigned to their workstation. 

HTH

Regards ... Chris