1. Berka Frenfert
  2. PowerBuilder
  3. Tuesday, 29 August 2023 06:20 AM UTC

Wondering if there is way to add a printer at runtime in PowerBuilder

Tomas Beran Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2023 12:30 PM UTC
  2. PowerBuilder
  3. # 1

Do you want add a printer from PB code? Try this https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32-printui but your user has to be a member of Administrator group for many steps.

If you mean if you can use a newly added printer when your app is running then I think it's possible at least since w10. I remember in previous windows versions there was a glitch. Newly added printers were not visible until the application restart and when you removed an active printer then the app simply crashed but I think it has been solved many years ago.

Comment
  1. Berka Frenfert
  2. Friday, 22 September 2023 13:45 PM UTC
Hi Tomas,

Thank you for the link. Yes, need to add new printer from PowerBuilder app. Actually, some printers cannot display print preview of some reports but not all the reports have this problem. When user opens a nested report then left and right borders automatically change their width and total width of the dw control become too small. I added a toolbar button to manually switch to preview mode but nested reports are still opening in print preview by default because they always open in preview.

If i remove printer drivers from control panel of windows then nested report open in normally.

Got myself involved in desktop app conversion to webapp and waiting for the right time to check the link.

Regards,

Berka
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.