Including Image in Jasper Report

I developed a report in iReport which includes an image. In the expression property for the image I inserted:

“CBC-Logo.jpg”

And this prints just fine in iReport. The image and report are located in the Program Files/Servoy/…/servoy_jasperreports directory.

However, when I try printing it from our Servoy solution, I get the following error message:

Byte data not found at location : CBC-Logo.jpg

at C:\Users\Steve\servoy_workspace\4.1.0_Lincage\forms\frm_rep_prt_rpts_main\frm_rep_prt_rpts_main_methods.js:17 (printReports)

Besides not printing correctly in Servoy, what interests me about this situation is that the error is reporting the Servoy workspace location of the calling form, not the Program Files location of the servoy_jasperreports directory where the report and image are located (and used by iReport).

I’ve tried copying the image to the directory mentioned in the error message, but that doesn’t help either.

Any ideas would be appreciated.

TIA, Steve

Have a look at this thread: viewtopic.php?f=11&t=11829&p=59265#p59265

Note: the directory you see in the error message is the reference to the line of sourcecode of your method in which you call the Jasper Reports plugin.

Paul

pbakker:
Have a look at this thread: http://forum.servoy.com/viewtopic.php?f … 265#p59265

Note: the directory you see in the error message is the reference to the line of sourcecode of your method in which you call the Jasper Reports plugin.

Paul

Thanks for the tip.

I was not able to get the directory from the example provided, but the example did give me the idea for saving the reports directory in a server_info table. Then, if it came time to print a report which had an associated image file, I got the directory from the table, appended it to the image file name and Servoy was able to find that full path name.

Thanks, Steve