Inserting a SVG chart in HTML file

Hello everyone!

I'm using Jasper integrated into Spring application (JasperReports 6.3.0).

I have a report (created with JasperSoft Studio) with a stacked bar chart within. It does print properly in pdf, xls, but does not in html, where the chart is displayed as an empty box - the src attribute of img element is empty. I've seen people saying I'd have to set up some kind of servlet to serve those files to html report. The most convenient way I can think of is to insert the chart in svg format, so can avoid doing this complicated stuff with serving images from a separate servlet, which could be extra complicated with environment I'm working on. I've set chart display type to svg, had to pull some extra libraries for svg handling, but the result of html print is the same - it's like Jasper wants to export the svg to image anyways, instead of simply putting it into html file.

Do I need to set some extra environment options, or do some other fancy stuff in order to get this working? Is this even possible?

If not, then maybe there's a way to convert the chart to Base64, and then also put it in image source? I'd really like to avoid setting up a servlet for serving all those images.

Thanks in advance!

pnawrocki's picture
Joined: Mar 23 2017 - 7:53am
Last seen: 6 years 21 hours ago

0 Answers:

No answers yet
Feedback
randomness