Jump to content
Changes to the Jaspersoft community edition download ×

setting image path from database


Recommended Posts

Hi all:

What I need to do is like a catalog. There's gonna be Items and the item's element are field of a database. In Example: Item's picture is a path to the picture stored as a string in the database.

Should I just put that field name into the image expression field? or I have to do a more complex walkaround.


thanks anyway.




pd: this new forum looks great, congratulations

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

thanks for the fast feedback.


Well the question was becouse ireport is giving me a error while testing with blank datasource. It tells me that there's no image.

I realize that it happens even with the images I set in design time. for example: "../logo/logo.jpg".

It's shown correctly on design time but on testing iReport gives me this error.


net.sf.jasperreports.engine.JRException: Image not found : ../logo/logo.jpg


could it be a relative url's problem. That would be terrible becouse I won't know the complete path to the catalog's images.

Post edited by: el_itur, at: 2006/07/19 20:02

Link to comment
Share on other sites

JasperReports does not support relative paths, iReport yes.


JasperReports accepts absolute paths and it looks for a resource on file system first, then in the classpath, so if your images are in the classpath, you can simply refer to them with the name.


An alternative is storing the path in a parameter to have expressions like:





Link to comment
Share on other sites

  • 6 months later...

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...