×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

New to PowerBuilder 6.0 and need help.

New to PowerBuilder 6.0 and need help.

New to PowerBuilder 6.0 and need help.

(OP)
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

RE: New to PowerBuilder 6.0 and need help.

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

https://docs.microsoft.com/en-us/windows/win32/pri...

RE: New to PowerBuilder 6.0 and need help.

Newer versions of PowerBuilder have a built in function PrintSetPrinter but I don't remember if PB 6 has that.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close