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

Inserting a SVG chart in HTML file


pnawrocki

Recommended Posts

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!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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