Jasper reports (plugin) and image path

Hi,

Our application may be installed on Windows or on Linux.

In our Jasper reports images are used.
The images in Jasper reports are stored with a path ( like c:\xxx\yyy\zz.gif)
This will of course not work when the same report is run on Linux.
I do not want to have different reports for Windows and Linux.
So my question is :

Is there a default directory where Jasper looks for images if no path is specfied for the Image ( like zz.gif )
and then Jasper will look for \zz.gif ???

Regards,

Found one way of doing this by using a parameter in Jasper/Ireports

parameter impath is set to “c:\xxx\yyy\”

then set the filepath of the image to :

$P{impath} + "zz.gif"

I can then include the parameter in the jasper plugin call.

For Linux the impath parameter can the be set to something like “/home/Jasper/images”

Still prefer to use a default image path.

Regards,

Hans,
I checked in the JasperSoft forum and one post indicates that there are two solutions (you provided a variant on one of them):

  1. put your default reports directory in the classpath
  2. pass in the complete path specification with the jasper report filename.

Personally I place “iReports” folder under the Servoy installation directory \server (3.5.7) pr application_server (4.x) and then I program the code that invokes the jasper report plugin to go find the directory under the Servoy install directory. (See this ref: http://www.servoymagazine.com/home/2008/10/article-client.html#more).
Regards
Tom