Timeouts and the EnablePrinter function call

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
Posts: 1
Joined: Mon Dec 18 2006

Timeouts and the EnablePrinter function call

Post by dbast »

Hello all,

I'm embedding some support for batch emailing PDF reports in an application and as part of my processing, I call the enablePrinter function, generate the report to PDF, then email the PDF to a userlist.

I have noticed on reports that take a long time: somewhere between 10 and 30 seconds (I haven't figured out the exact time yet) I receive the error:
Printer not activated, error code -30. I know this isn't simply a problem with the report as it works until I place a sleep() command in the code after the enableprinter and before the report generation in order to simulate a long running report.

For reports that take under a certain amount ot time to generate, I receive no error. Is there a timeout setting for the enableprinter that disables the enabled printer after a certain period?

Any help would be appreciated,
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002

Post by Joan »


Yes, there is a timeout setting for the EnablePrinter(). EnablePrinter() will activate the printer for 20 seconds, if printing starts after these 20 seconds printing will fail.

You need to call EnablePrinter() right before printing and better when catching the EnablePre() event of the driver.

Hope this helps.
Post Reply