iReport: Uploading Image to JasperServer (fail)

Chris picture Chris · Dec 22, 2010 · Viewed 9k times · Source

I am currently using a JasperServer repository to hold reports. I would like to include an image of a logo in the upper-right hand corner of the report. However, every time I attempt to add an image to the resources I get an error that says:

Error:
1 - 0

Any guesses?

Answer

Ingrid Wiederhecker picture Ingrid Wiederhecker · Mar 20, 2012

This is how I did it:

  1. Create a report on Ireport with a picture on it (e.g. logo.jpg)
  2. Edit the .jrxml file using a text editor.
  3. Search for the image file name. You will find the file name (with full path) in a cdata tag
  4. Change it to <![CDATA["repo:logo.jpg"]]>
  5. Save and Upload the report to the JasperServer
  6. Edit the report and choose Controls & Resources.
  7. Add a resource, select the image file (e.g. logo.jpg) and name it exactly as logo.jpg.
  8. Submit and... run... the report :) When you open the file again on iReport, it will only show an image generic icon...