1. Troy Cowan
  2. PowerBuilder
  3. Wednesday, 25 October 2023 18:04 PM UTC

The reference for the Print method when printing a single DataWindow or DataStore states that for DataStores, "the canceldialog argument must always be set to false."

Why is that?

Link to reference page: https://docs.appeon.com/pb2022/datawindow_reference/XREF_95965_Syntax_1.html

 

Troy Cowan Accepted Answer Pending Moderation
  1. Thursday, 26 October 2023 14:56 PM UTC
  2. PowerBuilder
  3. # 1

A related question: 

On failure, the Print() method returns -1. Is there anything after the fact that can be queried to get more information on the type/cause of the failure?

Comment
There are no comments made yet.
Troy Cowan Accepted Answer Pending Moderation
  1. Thursday, 26 October 2023 11:16 AM UTC
  2. PowerBuilder
  3. # 2

Thanks for the response. I ask because the app we are supporting (written long ago by others) does in fact call Print on a DS with the canceldialog set to TRUE. It is a GUI app so it seems to work just fine. I just wanted to know if there was something nefarious happening in the background we should be aware of. 

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 26 October 2023 16:45 PM UTC
Hi Troy;

Yes on a visual App, the print cancel dialogue can be opened by the PB runtime.

FYI: However, if you change the DS's behaviour by using the following setting in the PB.INI ...

[DataStore Behavior]

UseHwnd=no

Negating Window "Handles" increases the DS's performance exponentially which is desirable in many cases - but, it also disables the display of the cancel dialogue (negative side effect),

Regards .. Chris
  1. Helpful
  1. Troy Cowan
  2. Thursday, 26 October 2023 17:01 PM UTC
Well that is interesting. Does UseHwnd=no increase performance generally, or just under specific useages/circumstances?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 26 October 2023 17:12 PM UTC
Generally. Of course, the performance boost is tied directly into how much your PB Apps use DS's. ;-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 25 October 2023 18:20 PM UTC
  2. PowerBuilder
  3. # 3

Hi Troy;

  That is because the DS could be used in a "batch" or O/S "Service" based PB App that is non-visual and thus, can not interact with any App user. Trying to putting out a response window at this point then would be useless. Of course, the DS could be used in a Visual PB App but the compiler / runtime does not know that for sure.    HTH

Regards .. Chris

Comment
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.