Questions? Feedback?powered byOlark live chat software

Standard Support

Bug 1732

Default printer redirect on Windows Server 2016 doesn't work for RDS connection 14 November, 2018

Eric Cole
11 October, 2018
Product: PowerBuilder Category: Other
Version: 2017 R3 Publishing: Public
Status: Closed Priority: P3
Classification: Sybase (legacy) bug Resolution: FIXED
Mark Lee 24 October, 2018
Hi Eric,

Glad to hear that!
Thanks for your confirmation.
We will close this ticket!
If you have any further question, please open a new ticket!

Regards,
Mark Lee
Eric Cole 24 October, 2018
It worked!!

And yes, I guess I should've said that.  We're using the Print function on a datawindow to popup the dialog.  There are other places where we use the Print function without the dialog to go straight to the default printer.

We're also sometimes uses print jobs and the PrintDatawindow function.

We're going to be testing all those scenarios with this fix just to make sure.

Thanks.
Mark Lee 24 October, 2018
new pb dll files

Hi Eric,

The development team has fixed the issue regarding the Printer functionality. 
Please replace the PBSHR170.DLL, PBSYS170.DLL and PBVM170.DLL(default directory is: C:\Program Files (x86)\Appeon\Shared\PowerBuilder) with the attached ones and see if it is working on your side.
Please back up your old file before replacing them.
After that please restart the compute and see if it works on your side.
We also suggest that you verify if it has any impact on other Printer functions.

Regards,
Mark Lee
Mark Lee 24 October, 2018
Hi Eric,

1. Can you turn off UAC and test it again?
2. We are using WMware Workstation with VMware Tool is installed, we can’t reproduce your issue.
3. From your screenshot, it seems you are using the print function but not the PrintSetup() in your code.
If you are not using PrintSetup() to call this window, we suggest that you make a test case with only PrintSetup() code to verify if the popup window is correct (Ticket 1064 mainly resolves the default printer issue with PrintSetup()).  
4. If the above doesn’t resolve the issue, we suggest that we have a remote session to debug it.
 
We would recommend you to make the remote session during our working time which is 9:00 ~ 17:00 (we are in UTC+8 ) thus we can get the immediate help from the other team if necessary.
Please let us know when you can make the session and which tool you'd like to use for this session.(TeamViewer or GoToMeeting)

Regards,
Mark Lee
Eric Cole 23 October, 2018
The server is running on VMWare ESX 6.5 with VMTools installed.

IT verified the server is configured properly on #3 and the printing issue is only present on our powerbuilder program.
Eric Cole 23 October, 2018
Print Dialogs.PNG (95KB)

1. My account is an admin account on both machines.  It's not the "Administrator" account, but it has admin privileges.

2. Notepad works fine.  I have added a screenshot.  The print dialog from notepad is on the left and the one from our powerbuilder app is on the right.

3. I've asked IT about this and have yet to get a response.

4. The registry key was an attempt for me to help with the issue, it's not something we can solve.  I assumed that's where you were getting the default printer from as that's what comes up when you google this problem.  Apparently it's an issue across a lot of applications with windows server 2016.
Mark Lee 23 October, 2018
Hi Eric,

1.      We suggest that you test and see if it works when you use admin account for both machines.
2.      After you connect to Windows Server 2016 with RDS, please try printing with other applications like Notepad or Word and see if the default printer shown in the popup printer dialog is correct?
3.      If your Windows Server 2016 is on a virtual machine, please verify if you have enabled virtual printer for the virtual machine.
4.      Please let us know if your IT can resolve the registry issue. Thanks!

Regards,
Mark Lee
Eric Cole 22 October, 2018
Unfortunately it's still not working.  I copied the dll over and restarted the server and it's still not selecting the redirected default printer.

Our IT department has done some research into what the issue is and tried to find a workaround, but were unable to.  It has to do with a registry key that Microsoft changed.

The old registry key:  HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows:Device

Which now only shows the server's default printers, not the redirected ones.

The proper registry key it should be pointing to is:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices

This was changed after Windows 2012 R2.
Mark Lee 22 October, 2018
new pbvm170.dll

Hi Eric,

The development team has fixed the issue regarding the printer functionality.
Please replace the PBVM170.DLL(default directory is: C:\Program Files (x86)\Appeon\Shared\PowerBuilder) with this attached one and see if it is working on your side.
Please back up your old file before replacing them.
After that please restart the compute and see if it works on your side.
We also suggest that you verify if it has any impact on other printer functions.

Regards,
Mark Lee
Eric Cole 17 October, 2018
For that setting, it was already off on the server.  It was on on my machine.  I turned it off and tried again and it still didn't work.

I'm not changing the default printer on the server at all.  But yes, I've completely logged off the server and remoted back in and it still doesn't work.

The default printer of my user on the server is "Microsoft Print to PDF".

The default printer of my user on my current machine is "Sybase Datawindow PS".

When I remote into the server on the Remote Desktop Connection app that pops up with options before connecting, on the Local Resources tab, I have Printers checked.

When I remote in, if I go to the Printers & Scanners screen on the server, it shows all the local printers on the server, and all my redirected printers.  And the default printer is the one from the my machine "Sybase Datawindow PS (redirected 13)".  If I remote in and I do NOT have that Printers option checked then none of my local printers show up and the default printer is "Microsoft Print to PDF".

If I try to print anything that pops up a dialog box, when it pops up, the default printer selected is "Microsoft Print to PDF", the default printer of my user on that server, not the redirected default local printer .
Mark Lee 17 October, 2018
let Windows manage my default printer

Hi Eric,

Thanks for feedback this info!
1.      Please confirm if you have removed let Windows manage my default printer.
2.      In my test, when you remote to Windows server 2016, the first time to get the default printer is correct. But it fails the second time.
3.      Can you provide me your detail test steps?
 
BTW, did you restart your app every time you changed your default printer?

Regards,
Mark Lee
Eric Cole 12 October, 2018
(In reply to Mark Lee from comment #2)
Hi Eric,

Thanks for reporting this problem!
Yes, R3 has fixed the issue of ticket 1064.
 
Can you let me know if you are using Win7 32bit machine or Win10 64bit
machine to remote to Windows Server 2016?
We will set up such an environment to verify your scenario.

Regards,
Mark Lee
I'm using Windows 10 64 bit to remote in.
Mark Lee 12 October, 2018
Hi Eric,

Thanks for reporting this problem!
Yes, R3 has fixed the issue of ticket 1064.
 
Can you let me know if you are using Win7 32bit machine or Win10 64bit machine to remote to Windows Server 2016?
We will set up such an environment to verify your scenario.

Regards,
Mark Lee
Govinda Lopez 11 October, 2018
Hi Eric,

I will transfer this ticket to our engineering team for further analysis. We will keep you posted on the results here.


Regards,
Eric Cole 11 October, 2018
*Phenomenon: Running a powerbuilder app on windows server 2016 through a RDP connection and using a redirected local printer as default.  When printing it doesn't print to the default printer if no printer dialog box is used.  If you pop up the printer dialog box the default printer is not selected.


*Reproduce Steps:


Remark:

This is the same as Bug 1064 https://www.appeon.com/standardsupport/search/view?id=1064

But I can't post to that bug and the person who started that one hasn't responded to you yet.

I was hopeful that R3 would fix this issue, but we have upgraded and it still doesn't work.  The redirected local printer is still not the default when the printer dialog pops up.

We're still running our powerbuilder app on windows server 2008 and would really like to upgrade to 2016 but this issue is big for us because we do a lot of printing to the default printer.
OS:
Windows Server 2016 
Platform:
64-bit 
Database Type:
Microsoft SQL Server 
Database Version:
2016 13.0.5026.0