Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to PowerBuilder 6.0 and need help.

Status
Not open for further replies.

knu2pb

Programmer
Sep 16, 2019
1
US
I have been assigned the task of changing some PowerBuilder 6.0 code. I have never seen PowerBuilder before this and need help. The program is printing a datastore. The user doesn't want to print it anymore but just wants to look at the data. The plan is to save it to a file so they can look at it. I have tried SaveAsAscii and SaveAs a text file but when I look at the file not all of the data or labels are there. I changed my local printer to Microsoft Print to PDF and ran the program as is and it created a pdf file with all the information and labels. I don't think I can get the users to change their default printer and then change it back everytime they want to see this one file. Is there an Easy way to save the datastore, in PB 6.0, so that all labels and data show up ? Or is there a way to programmatically change the printer to Microsoft Print to PDF, in PB 6.0, and then change it back to their default printer after it has finished ? They don't want to add a new DataWindow. This program will go away in 5 or 6 months. It's difficult to find information on PB 6.0. I have already spent too much time on this. Any helpful information will be appreciated.
Thanks
 
Add this external function declaration and then call the function:

Function Boolean SetDefaultPrinterA(String pszPrinter) Library "Winspool.drv"

The documentation says that you have to use the driver and port but I don't think that is true. On my machine it would be "Microsoft Print to PDF~twinspool~tNe02:".

 
Newer versions of PowerBuilder have a built in function PrintSetPrinter but I don't remember if PB 6 has that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top