1. Mateus Tonelli
  2. PowerBuilder
  3. Tuesday, 5 January 2021 18:25 PM UTC

Calling PrintGetPrinter() with no printers on the workstation causes (a crash of an application if compiled or the Powerbuilder IDE if run in debug mode).

This is under Powerbuilder 2019 R2 Build 2328.

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 5 January 2021 18:41 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Mateus;

  Just use the PrintGetPrinters () command first to see if the related PB App's machine has any default printer assigned. If not, then bypass the PrintGetPrinter command.  HTH

Regards ... Chris

Comment
  1. Mateus Tonelli
  2. Thursday, 7 January 2021 11:02 AM UTC
Hi Chris, if for other circumstances i don't have any default printer there is any function that i can use to avoid the call of PrintGetPrinter
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 7 January 2021 16:28 PM UTC
Use PrintGetPrinterS first to see if you have any printers. HTH
  1. Helpful
  1. Mateus Tonelli
  2. Friday, 8 January 2021 10:56 AM UTC
Thanks Chris i think i understood what i where doing wrong.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 5 January 2021 19:55 PM UTC
  2. PowerBuilder
  3. # 1

I am pretty sure that not having a default printer can effect the layout of datawindow reports, especially in preview mode and when you have controls close to the page border.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 5 January 2021 19:59 PM UTC
Hi Roland;

Correct ... the DWO renders itself at runtime as a Bitmap and uses the default printer's "fonts" to generate the image of itself.

Regards ... Chris
  1. Helpful
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 11:12 AM UTC
  2. PowerBuilder
  3. # 2

Hi

In PB2019 R3 PrintGetPrinter() won't crash anymore (https://www.appeon.com/standardsupport/search/view?id=5553)

Regards
Arthur

Comment
  1. Mateus Tonelli
  2. Friday, 8 January 2021 10:57 AM UTC
Thanks Arthur.
  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.