Home:ALL Converter>JasperReports - Embedding chart as SVG into HTML report

JasperReports - Embedding chart as SVG into HTML report

Ask Time:2017-03-24T04:24:50         Author:Aderon

Json Formatter

I'm using JasperReports integrated into Spring application (JasperReports 6.3.0, SpringBoot 1.4.1).

I have a report (created with Jaspersoft Studio 6.3.1) with a stacked bar chart within. It does print properly in pdf, xls. The problem is html format, which has the chart displayed as an empty box - when you look at the source code, the src attribute of img element is empty.

I've seen people advicing setting up some kind of Jasper-defined servlet to serve images as static files to html report, though this might be extra complicated with environment I'm working on.

The most convenient way I can think of is to insert the chart in svg format, so that it would be present inside the html content - this is my preferred solution to this.

The chart element (in report desing) actually has an option to be displayed as svg, though changing this doesn't seem to affect html output at all, just like Jasper would want to export the created svg to a file, and then include it as image anyways.

I've tried several config options, but I'm kind of stuck now, so my question is:

Do I need some extra environment setup, or some other fancy stuff, to reach my goal? Is what I ask for even possible with JasperReports?

Thanks in advance!

Author:Aderon,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/42986306/jasperreports-embedding-chart-as-svg-into-html-report
yy