سؤال

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?

هل كانت مفيدة؟

المحلول

The most likely reason for the error that you are seeing is that there's a problem with the web services configuration. The most likely problem is that the image is greater than 16Kb, so Axis needs to save the attachment to a temporary directory. A useful test is to make sure that images smaller than 16Kb work with no problems.

Your quickest workaround is to upload the picture via the JasperServer web UI. Then your report should work as expected. If so, it's also validation that the problem is with web services (not with the repository database or some other component).

The most likely permanent solution is to recursively change ownership of the directory .../webapps/jasperserver/. Or you might prefer to only chown .../webapps/jasperserver/WEB-INF/attachments. Or you could change the attachments directory by editing this line in server-config.wsdd:

<parameter name="attachments.Directory" value="attachments"/>

نصائح أخرى

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...
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top