Problem with print metod

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
jonlars
Posts: 2
Joined: Tue Jan 13 2009

Problem with print metod

Post by jonlars » Thu Jan 15 2009

Hello,
I'm using pdfcreactivex.dll version 3.0.3.4 with Powerbuilder 10.5.2 and have problems when users cancel the print dialog.
We got ”Error calling external object function print at line 17 …”.
The only code on line 17 is
ole_invoice.Object.Print("", true)
If the user don’t cancel it works. If we change to false it works but we want to be able to change printers.

Any suggestions?

David
Amyuni Team
Posts: 89
Joined: Mon Dec 18 2006

Re: Problem with print metod

Post by David » Tue Jan 20 2009

Hello

When the user cancels the print job, the Amyuni Creator throws an exception which the developer needs to handle.

Hope that helps?
David
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php

jonlars
Posts: 2
Joined: Tue Jan 13 2009

Re: Problem with print metod

Post by jonlars » Fri Jan 23 2009

How do I handle that i PowerBuilder?
I get the error before I can handle any exceptions.

eric.glenn
Posts: 11
Joined: Tue Sep 02 2008

Re: Problem with print metod

Post by eric.glenn » Mon Nov 23 2009

It is possible to trap errors by using

TRY CATCH (see PowerBuilder documentation appropriate for your PowerBuilder version)

or

using the systemerror event of the application object

Example code for systemerror event

Code: Select all

/*
Error property	Datatype	Description
ClassDefinition	PowerObject	An object of type PowerObject containing information about the class definition of the object or control. 
Line	Integer	Identifies the line in the script at which the error occurred.
Number	Integer	Identifies the PowerBuilder error.
Object	String	Contains the name of the object in which the error occurred. If the error occurred in a window or menu, Object will be the same as WindowMenu.
ObjectEvent	String	Contains the event in which the error occurred.
Text	String	Contains the text of the error message.
WindowMenu	String	Contains the name of the window or menu in which the error occurred.
*/

error l_error
l_error = error
string ls_error

ls_error = &
"Object " + l_error.Object	 + &
" ObjectEvent " + l_error.ObjectEvent + &
" Line " + string( l_error.Line ) + &
" Error Number " + string( l_error.Number ) + &
" Error Message " + l_error.Text + &
" WindowMenu " + l_error.WindowMenu

messagebox( "Error", ls_error )

Post Reply