Jump to content
We've recently updated our Privacy Statement, available here ×

Referencing images using the REST XHTML Exporter


peter_tonev

Recommended Posts

Hello community,

 

I have a report with a logo in it (jpg). When I call the report using the rest_v2/reports service and use PDF as export format, the logo image gets rendered. If I use HTML though, I only get a broken image icon.

My image expression is "repo:/Reports/MyLogo.jpg" where "Reports" is the folder name where both my reports and the image are.

I call my report using

https://<<myJasperHost>>/jasperserver-pro/rest_v2/reports/Reports/<<myReport>>.html

and

https://<<myJasperHost>>/jasperserver-pro/rest_v2/reports/Reports/<<myReport>>.pdf

respectively.

My image expressin class is String, but I already tried the others and also all possible options on the image element.

How can I reference the image - do I need another REST call (and how would it look like)?

 

Thanks & Cheers,

Peter

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi Teodor,

 

the image tag (which works with the PDF exporter) is:

 

"repo:/Reports/MyLogo.jpg"

 

It doesn't work with the XHTML exporter.

I'm not sure though whether I simply don't use here the proper image embedding settings or if we possibly have some issue with our application configuration, so the XHTML exporter cannot export the image together with the report.

 

The workaround which functions with XHTML was to deploy the image on a web server within our domain (relative path to it being /styles/img/reports/), then my JRXML image tag looks like:

 

"/styles/img/reports/MyLogo.jpg"

 

Thanx,

Peter

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