Powerbuilder 9

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
RM
Posts: 2
Joined: Tue Feb 03 2004

Powerbuilder 9

Post by RM »

We recently upgraded from Powerbuilder 7 to Powerbuilder 9 and starting having problems with the PDF Export. The user exports the datawindow to a PDF file successfully, but upon returning to the Powerbuilder app and trying to print, the Printer dialog box does not show the users network printer and the printer name cannot be changed for some reason. If the user clicks on the OK button, the Print process hangs up on LPT1. Their default printer is a network printer not LPT1. The application gives him an error message and then the app freezes. He has to shut down the app thru the Task Manager and then re-open it. The print works fine if he prints before exporting the datawindow.

I've never worked on this code before and I'm not sure how this amyuni dll works or where the documentation is on it. How do I get the printer to reset to the users default network printer after the datawindow is exported? I can't even duplicate the problem in my development environment but it looks like some users are 'registered' and some are not but I don't know what that means.

Has anyone else had a similar problem when upgrading from Powerbuilder 7?

Thanks for any help!
RM
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I didn't work with Powerbuilder 9 too, but I did work with Powerbuilder 8 and I know that in Powerbuilder 8 the default windows printer is ignored and you need to use a new PB8 command PrintSetPrinter() to set the print
destination.

The documentation for the Developer version of the PDF Converter is available in "Common Driver Interface.pdf" that you must have received with the PDF Converter.

You said:
I can't even duplicate the problem in my development environment but it looks like some users are 'registered' and some are not but I don't know what that means.
I am not sure I got what you mean, do you mean that at your client site some users are registered to the network and some are not? If a user was able to print to the network printer before exporting a file to pdf than he / she should be able to print again after the export.

I guess PrintSetPrinter() should help, unless some changes have been made to Powerbuilder 9.
RM
Posts: 2
Joined: Tue Feb 03 2004

Powerbuilder 9

Post by RM »

Our code works differently on the developer's machines where it is dynamically registered than it does on the user's machines which have the PDF driver registered at all times. It also uses a different DriverInit function based on whether a developer is running the code or a user.

I've tried the PrintSetPrinter and it doesn't help.

When the PB object is constructed, the ActiveX object is declared in the instance variables. At first, I couldn't even get the original default printer name but, after moving the PrintGetPrinter command to an instance variable and placing it before the activeX oject is declared, I was able to keep the old variable. Prior to that, the original printer name was always the PDF Printer name.

I'm still unable to get the printer set back to the original default value though. Now when I try by using either the "pdfobj.RestoreDefaultPrinter"
or "adw_datawindow.Object.Datawindow.Printer = is_old_printer"
or "li_rtn = PrintSetPrinter(is_old_printer)", the printer dialog box within the PB report has a "?" and you can't change the printer. If I check my printers thru the Windows Printers, it shows the PDF print driver as the default but it should be my original default network printer.

On the bright side, my developer and executable version now work the same even though it still doesn't work.

Has anyone else been able to get this to work in PB9?

Thanks,
RM
Post Reply