Jump to content
JasperReports Library 7.0 is now available ×

Image Location Problem


berlim

Recommended Posts

Hi,

 

I am not sure if I found a bug or if what I am doing is just not allowed. I would like to add an image to my jrxml, but there is no way to embed the image in the template. Thus, I created a folder called images that will stay in the same folder where all the tmeplates are located. Then, I put the location of the image as

images image.jpg

(The backslashes aren't appearing for some reason, so they are located where the spaces are)

 

This works fine on iReport and the pdf I am creating compiles correctly, but when I run the java code to compile the pdf, it says that the image cannot be located.

 

Does anyone know of any way to get this images folder to work, or another way around it. The reason I am doing this is because I don't want the tempalte to have to know the exact location of the images, just where they are in relation to the templates.

 

Thanks, any help is appreciated.

 

Post edited by: berlim, at: 2007/08/24 17:47

 

Post edited by: berlim, at: 2007/08/24 17:48

Post edited by: berlim, at: 2007/08/24 17:48

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi!

Maybe the problem is with the 'current directory' ...

"but when I run the java code to compile the pdf"

-> in which directory is this application run?

The images/image.jpg is probably relative to the current directory of the application, not the directory where the .jasper file is located.

 

Hope this helps a bit,

Sebastian

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...