Jump to content

Linking an image on report for deployment


jbo_master

Recommended Posts

Hello @all,

i have the following problem:

I have a report with an image on it
I have set the property of the image to "repo:/Reports/TestReport/Resources/image.jpg"
I deployed the report with the help of the "repository server" to jasperserver.
I uploaded the image to the Resource-folder.

On executing the report i am getting the following error:

com.jaspersoft.jasperserver.api.JSExceptionWrapper: Error loading byte data : repo:/Reports/TestReport/Resources/image.jpg

com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: Error loading byte data : repo:/Reports/TestReport/Resources/image.jpg

It seems that JasperServer can not resolve the path to the image?

Any ideas?

Thanks in advance


 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I finally found the solution. ;)

There are two possibilities.

1.) If the report is deployed as a "report unit" and the image is provided in the "Resources" folder, the path (image expression) has to be the following: "repo:imagename.jpg"

By the way. The same could be applied to link a subreport to the main report. Add your Subreport-JRXML-File to the Resources of your Report-Unit and change the subreport expression to the following: "repo:nameOfYourSubreport.jrxml"


2.) Deploy your report as a "report unit", create a new folder for example "images" on the JasperServer with the help of the  Webadmin-Interface, upload your image into this folder.
The path (image expression) to your image would be the following: "repo:/images/imagename.jpg"


 

Link to comment
Share on other sites

  • 2 years later...

The tool JDeploy! on http://sourceforge.net/projects/jaspertools/?source=directory

allows to deal with reports deployment on diferents environments (development, pre production, production). It dont touch the datasources when deploying a report, so the systems department can define it. It also defines a estandarized way to package the reports and subreports of a project on a zip file. And includes other utils to list reports, create datasources,... It arranges the problem of image paths before upload the report to the server.

I hope to helped you.

bye.

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