Has Powerbuilder addressed the issue that Windows introduced in Server 2016 where in some remote environments there is an issue when mapping default client printers and that information being retained outside of the current session? Here is an article we would outlining the issue https://social.technet.microsoft.com/Forums/windowsserver/en-US/785cbcc6-4f0b-4d88-b12f-2b1d89b85a44/remoteapp-default-printer-redirection-not-working-in-server-2016?forum=winserverTS
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Windows Server 2016 and default client printer
- Tina Prestas
- PowerBuilder
- Wednesday, 31 January 2018 18:04 PM UTC
- Tuesday, 6 February 2018 08:58 AM UTC
- PowerBuilder
- # 1
Regarding specifying default printer issue in remote Windows Server 2016, PB 2017 itself doesn’t do any optimization. After all, this issue is caused by Windows environment.
We haven’t used RemoteApp tool, so we are not sure whether the issue also exists in PB 2017.
We will also study and verify the issue with using this tool.
Regards,
Mark Lee
- Thursday, 17 January 2019 16:25 PM UTC
- PowerBuilder
- # 2
We've been having this problem as well.
When you run a remote app, the printer info is copied from your local profile to your profile on the server. This allows the remotely run app to see your local printers and to know which one is default.
The problem is that the profile update and the application are run in parallel. When the PowerBuilder runtime calls GetDefaultPrinter, the operating system hasn't finished copying the profiles so the application has the wrong printer as the default.
To get around this, you need to call GetDefaultPrinter from your PB code and then feed the result into the built in function PrintSetPrinter.
Because the profile update may not be finished, you have to wait as long as possible before doing it. In our app I added it to the end of the main window pfc_postopen event.
- Roland Smith
- Thursday, 17 January 2019 16:28 PM UTC
String ls_null, ls_DefaultPrinter
ULong lul_buffer
// Size the buffer
SetNull(ls_null)
GetDefaultPrinter(ls_null, lul_buffer)
ls_DefaultPrinter = Space(lul_buffer)
// Get the Windows default printer
GetDefaultPrinter(ls_DefaultPrinter, lul_buffer)
// Set the PowerBuilder default printer
PrintSetPrinter(ls_DefaultPrinter)
-
Helpful Loading... Helpful 0
- Friday, 18 January 2019 09:36 AM UTC
- PowerBuilder
- # 3
Hi Tina,
This issue has been fixed in this latest beta release. Please visithttps://www.appeon.com/developers/pb-2019-beta.html for details about the Beta Program (including the GA release schedule) and download and install the beta version to verify the issue.
The fix will also be included in the coming PB 2017 R3 MR release. It is scheduled to be released by the end of this month. You can get the latest status from this link:
Regards,
Mark Lee
- Vipin Dwivedi
- Tuesday, 2 March 2021 07:57 AM UTC
I upgraded to build 1915 but still it does not highlight the default printer all the time. My application is calling PRINT() in-built function but no luck.
Even PrintSetUp() dialog box does not highlight the default printer.
I am not sure if I need to apply Roland's fix to call GetDefaultPrinterW() Windows API.
Vipin.
-
Helpful Loading... Helpful 0
- Vipin Dwivedi
- Friday, 5 March 2021 22:58 PM UTC
Waiting for your comment. Shall I go and apply Roland fix or Appeon is going to do something?
Vipin
-
Helpful Loading... Helpful 0
- Mark Lee @Appeon
- Monday, 8 March 2021 07:52 AM UTC
Sorry for the late reply.
We suggest that you try Windows API GetDefaultPrinterW() Windows API.
BTW, I also checked your post on the community site, and it seems that is a new bug that we didn’t fix before.
If the issue can’t be worked around, I suggest that you report this problem to our ticket system: https://www.appeon.com/standardsupport/newbug so it can be properly received and tracked.
Please also provide a sample PB test case (with PBT/PBL) when you submit it to the ticket system.
Regards,
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.
Did you get any fix? I tried in PB-2017R3 MR 1858,1880, 1915 but all are highlighting the server printer and not client redirect printer. PrintGetPrinter() in-build PB function gives different result(server default printer) while GetDefaultPrinter() gives client redirect printer (but not all the time).
Any luck?
Regards.... Vipin