Using SVG image

I have a report where I should use a very specific map-based chart so I thought about using SVG files. I've read you can use SVG files with jasper reports using Batik Renderer but I would like to know whether it is possible to modify SVG elements from that chart according to data. That is, my SVG is not a static image file but a chart that should be dependant on data.

An alternative would be using java to generate the svg bytes then passing these to Jasper, is it possible to programmatically add a SVG image to a report?

gabriel.sanmartindiaz's picture
Joined: Jun 12 2013 - 4:07am
Last seen: 7 years 4 months ago

2 Answers:

If you generate a SVG document in your code, you can pass it to the report as a parameter (either byte array or String), and create a BatikRenderer instance using the parameter value.  See the Javadoc for details on the BatikRenderer methods.

HTH,

Lucian

lucianc's picture
72603
Joined: Jul 17 2006 - 1:10am
Last seen: 11 hours 6 min ago

I created an SVG file with batik. It can be opend with the browser - looks fine.
But how do I get the "needed" byte array...? Do I have to generate a file first or when is the "turn-over-point" ?^^

Timbo2013 - 9 years 6 months ago

*delete*

Timbo2013's picture
299
Joined: Aug 5 2013 - 5:32am
Last seen: 9 years 4 months ago
Feedback