1. Peter Thiem
  2. PowerBuilder
  3. Thursday, 3 February 2022 04:05 AM UTC
Hi Community,
As per https://community.appeon.com/index.php/qna/q-a/pb2019-r2-build-2328-default-printer-setting-issue, there is a problem where the initial selected printer would be set to the "last printer in the printer list".

I tried using pb.ini with "[Application] Citrix=1" with PowerBuilder 2021 GA (build 1311) in Citrix (on Windows Server 2016).
It partially helped, if the user opens the PrintSetup() it will show the systems default printer as the selected printer.
But the application now has two other problems.

1. If the user prints (a window, or a RTE, for example) without ever opening the "PrintSetup()", then the application still prints using the "last printer in the printer list", instead of the default printer that the local computer/citrix have set.

2. Every time the user opens the "PrintSetup()" (available in the applications menu, for this application), the selected printer reverts back to the default printer that the local computer/citrix have set, rather than the printer selected by the user when they last used "PrintSetup()".
Are these powerbuilder bugs?

Or due to not using the settings correctly?

Is there a way to have the correct printer (as per the local computer/citrix setting) set automatically, without having the user execute "PrintSetup()" prior to the first time of any printing?
I am wondering if I should write some timer that runs for the first 60 seconds, to try to set the selected printer to the systems default printer, myself.

Cheers, Peter.

P.S. Our citrix environment is siloed off from me, so it is hard to do experiments, sorry.
Accepted Answer
Peter Thiem Accepted Answer Pending Moderation
  1. Wednesday, 2 March 2022 06:41 AM UTC
  2. PowerBuilder
  3. # Permalink

For Posterity,

With regards to using a Powerbuilder Application in Citrix and the Default Printer.



Custom Code

We have implemented custom code in a timer to check the operating system default printer (windows api call) for 1 minute (configurable) of startup, and to update the powerbuilder default printer to match.

With an extra checks that the user has not already used "PrintSetup()" to explicitly select a printer.

This seems to work for this application well (so far in testing) and solves the problems we had run into.


Using pb.ini with "[Application] Citrix=1"

This has it's merits, but drawbacks as well.

If user prints before using "PrintSetup()", the PowerBuilder default printer is the last one in the list - not the users default printer. Consequently, it is required that the users use "PrintSetup()" at least once before any printing.

Every time the user uses "PrintSetup()", the selected printer resets to the operating systems current default printer - not the last printer the user most recently selected.

We are not using this setting due to these drawbacks.


Using user the citrix policy setting "Wait for printers to be created" before starting the application

We did NOT user the citrix setting "Wait for printers to be created".


This setting will delay starting the application until all the printers have become available in the citrix environment. It seems like an option perfect for PowerBuilders problem in this area.

Our citrix admins recommended against it - they don't use it for any other applications in this organisation or in prior organisations they've worked for.

They warned that some users may have printers that malfunction resulting in long delay to startup, or even complete failure, and also the problem is difficult to troubleshoot.

We tried it, and it added 10 seconds to startup for a sample of users, but we can't easily say for all users the impact (other than turning it on in production, as seeing the fallout).

Still it looks like a good option if custom code is unviable, and supporting users with citrix printer creation problems is viable.

It is a fallback option we could use if we run into further problems.



Thanks again for the community, as least I found out there was no well known obvious solution.


  1. Armeen Mazda @Appeon
  2. Wednesday, 2 March 2022 15:30 PM UTC
Thanks for sharing this info!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 4 February 2022 10:46 AM UTC
  2. PowerBuilder
  3. # 1

Hi Peter,

I'd recommend creating a ticket for this on https://www.appeon.com/standardsupport/newbug 


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.