Jump to content
Changes to the Jaspersoft community edition download ×

Relative path to image


jonathanln

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Ah, it doesn't work if the image is in a custom template that you've made since the path is relative to the report and not it's template. ( my template and my report are in different folders...)

 

If anybody knows a way, please tell me.

 

Thank you,

 

John

Link to comment
Share on other sites

There are several ways to locate an image.

JasperReports tries to resolve the image position in this way:

1. It checks if it can be an absolute path
2. It checks if it can be a relative path of the report (if the jasper has been loaded from a file)
3. It tries to load the path from the classpath

The best option: be sure the image (or the root directory if you want specify a path like "images\tests\foo\myImage.gif") is in the classpath.

A last note: iReport puts in the classpath the report directory automatically.

Giulio

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