1. Vipin Dwivedi
  2. PowerBuilder
  3. Wednesday, 27 November 2019 19:03 PM UTC

Hello Appeon Folks,

Greeting! and Happy ThanksGiving!

We are currently using PB2017R3-1858 version. We have observed few things related to Print(). When application runs in window 2008 or prior version it is giving highlighting different default printer while in windows 2016 it is highlighting different default printer. One thing I want to mention that application is running through Citrix at users.

I want to know is there any problem calling Print() in different OS version?

What Windows API internally PB calls when we use Print() which open print dialog box?

What windows API internally PB calls when we call PrintSetup() which opens Printer dialog box and from where it is pulling the records?

When we select the printer using PrintSetup(), where does it store the printer in Registry?

Please suggest.

This is causing the problem at user machines? When they login first time they see the correct default printer in print dialogbox but if you change the default printer in print dialog box by right clicking any other printer and set as default. After that if you open the print dialogbox using Print(), it is still highlighting the old printer which is not your default printer anymore.

Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 March 2021 09:57 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Vipin,

I can reproduce your problem. And these problems all exist in PB 12.6. It is normal behavior.

The issue also exists when you use the RDP method to connect to the machine, use a local machine, and even though when you don't use the Citrix machine.  

Please note that after the PB application is launched, it will get a default printer and store it to the application according to the current Windows printer settings.

However, after the PB application is launched, if you dynamically modify the default printer of Windows or highlight other printers, the settings won't apply to the PB app.

 

You can refer to the PB local help documentation for details and you can also check the online help in the link below:

PrintSetup

https://docs.appeon.com/pb2019r3/powerscript_reference/ch02s04s600.html 

Usage

The user's settings have effect for the duration of the application only. After the application exits, printer settings revert to their previous values.

PrintSetupPrinter ()

https://docs.appeon.com/pb2019r3/powerscript_reference/ch02s04s601.html 

Usage

You can display the printer setup dialog box for different printers by first calling the PrintSetPrinter function. You cannot change the printer by calling PrintSetupPrinter as you can with the PrintSetup function.

 

if you need to modify the default printer name stored in the application after the app is launched, you can use the PrintSetPrinter method to modify it.

See the sample code below:

long ll_place
string ls_setptr
string ls_prntrs = PrintGetPrinters ( )
 
ll_place=lastpos (ls_prntrs, "~n") 
ls_setptr = Mid (ls_prntrs, ll_place + 1)
PrintSetPrinter (ls_setptr)
PrintSetupPrinter ()

BTW, the printer setup dialog box window the PB Print method called is the Windows underlying window, so the default printer displays in this window is the same as that set in the current Windows system.

 

Regards,

 

Comment
  1. Vipin Dwivedi
  2. Thursday, 11 March 2021 06:18 AM UTC
Support ticket created for same. Here is the link for your reference https://www.appeon.com/standardsupport/track/view?id=6261. Let me know if any question.



Regards... Vipin
  1. Helpful
  1. Mark Lee @Appeon
  2. Thursday, 11 March 2021 06:26 AM UTC
Hi Vipin,



Thanks for your patience and understanding. I will response to you in ticket 6261.



Regards,
  1. Helpful
  1. Vipin Dwivedi
  2. Thursday, 11 March 2021 15:59 PM UTC
Hey Mark,

I did receive your email and thank you for that. You mentioned in your email to try to upgrade PB2019 R2 and R3. But we are not going to upgrade our product so soon. Let me know is there anything you can do with current PB2017 R3-1858 version.



Regards... Vipin



  1. Helpful
There are no comments made yet.
Vipin Dwivedi Accepted Answer Pending Moderation
  1. Friday, 15 January 2021 20:39 PM UTC
  2. PowerBuilder
  3. # 1

Chris,

Please confirm MR Release where this has been fixed in PB2017R3.

Comment
  1. Vipin Dwivedi
  2. Thursday, 4 March 2021 19:26 PM UTC
Chris/Armeen,

I download MR 1915 and re-build the Executable and deployed with 1915 PB runtime DLL. I see two observation here when running application through RDP

1 - When I call PB in-built function PrintGetPrinter() it returns local printer of server while GetDefaultPrinter() OS function (from library winspool.drv) gives redirect printer which is default to my local machine. so PrintGetPrinter() does not return the correct default printer therefore it highlight the non-default printer when print dialog box open.



2 - I put both function call at two three place.... so that I can see if changes at any moment. so I observed that it returns different default printer during first 2 calls

PrintGetPrinter() - returns local to server default printer

GetDefaultPrinter() OS function - returns redirect printer (local to my machine server)

next call starts giving me same default printer from both function which is redirect printer (my local default).



Looks like we still have issue in MR 1915. Kindly suggest.



Regards,

Vipin

  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 4 March 2021 19:49 PM UTC
Hi Vipin;

That is some great detective work thus far. Since you seem to have a small PB test case. please open a support ticket and attach your printer test app to the new ticket. Much appreciated!

Regards ... Chris
  1. Helpful
  1. Vipin Dwivedi
  2. Thursday, 11 March 2021 06:19 AM UTC
Hello Chris,



Support Ticket created.



https://www.appeon.com/standardsupport/track/view?id=6261



Regards..... Vipin
  1. Helpful
There are no comments made yet.
Vipin Dwivedi Accepted Answer Pending Moderation
  1. Thursday, 28 May 2020 18:01 PM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

Can you please confirm if this have been resolved in PB 2017R3 - Build 1858? Our application is running in this version.

 

Your help is much appreciated.

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 28 May 2020 19:06 PM UTC
Hi Vipin;

From the Support Database .... "Works OK in PB 2017 R3 Build 1858. Fails in PB 2017 R3 Build 1915. Then working OK again in PB 2019 R2 Build 2328.

HTH

Regards .. Chris
  1. Helpful
  1. Vipin Dwivedi
  2. Friday, 29 May 2020 04:38 AM UTC
Hello Chris,

Thanks for your prompt reply. I see couple of thread where it says, 2017R3-1858 did not resolve the default printer issue for windows 2016. Do you have any link which confirms that this got fixed in MR-1858 in 2017R3?



Thanks,

Vipin
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 29 May 2020 14:57 PM UTC
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 November 2019 19:23 PM UTC
  2. PowerBuilder
  3. # 3

Hi Vipin;

  Sounds like the same print issue(s) as documented in the Support Ticket system. Ticket numbers 3620 and 1064. This problem is reported as fixed in PB2019. The same fix should be applied to the upcoming PB2017R3 MR (Maintenace Release) due out in the next week or so AFAIK.

HTH

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 27 November 2019 19:36 PM UTC
When your PB App uses the built-in PrintGetPrinters() command as an example, the PB run-time just calls the equivalent "Enumprinters" command API in the O/S ( https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The issue here seems to be the execution of your application(s) under the Citrix environment that somehow makes the printer commands behave differently.
  1. Helpful
  1. Vipin Dwivedi
  2. Wednesday, 27 November 2019 20:26 PM UTC
Where does printer value get stored in registry when we select the printer from PrintSetup() dialog box?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 27 November 2019 22:29 PM UTC
The PB run-time only holds the selected printer from the PrintSetup() command in memory. Once the App session terminates, that printer setting is lost.
  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.