datastore.print() occasionally returns -1 under EAServer 4.2

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: Tue Aug 19 2003
Location: Tampa, FL

datastore.print() occasionally returns -1 under EAServer 4.2

Post by wpfeiffe » Tue Aug 19 2003

I have just started using Amyuni (replaced the Acrobat PDF Driver) with EAServer for our PB report engine. Using EAserver 4.2 and PB 8.

My retrieval and printing works for the most part but I occasionally will get a good retrieve and then get a -1 on the print. I have this fail the print job, but the -1 really doesn't yeild much info.

I am having the reports print via multiple threads and am using the example amyuni multithreaded code with the cdintf.dll activex.

My code is attached below.

Any ideas on how to start debugging this?




public subroutine of_print (datastore anv_ds, string as_filename, string as_print_job);// Create the ActiveX object
// To be able to use the ActiveX interface CDINTF should be registered in your application folder using Regsvr32
oleobject pdfobj

pdfobj = create oleobject

// Connect the pdfobj ole object to the cdintf interface of CDIntf.dll
// To be able to use this dll CDIntf should be registered in Windows.

// Attach to PDFprinter
pdfobj.DriverInit (PrinterName) // PrinterName is declared as the name of the existing printer
// PDFPrinter.PdfDriverInit "My PDF Export" this is for the developer version to install the printer
// only for the time the application is running and remove it after.

// Set this printer as default

// For Each report to be printed:

anv_ds.Object.DataWindow.Print.DocumentName = as_print_job

pdfobj.Lock(as_print_job) // The Lock/Unlock functions are available in version 2.06 of the PDF Converter

pdfobj.SetDocFileProps(as_print_job, 1 + 2, "", as_filename)

// Enable the printer before each printout. This is for the Developer version 2.1


pdfobj.Unlock(as_print_job, 180000) // 3 minutes

// End for each report


destroy pdfobj

end subroutine

Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002

Post by Joan » Mon Aug 25 2003

Please send us your code to


Post Reply