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

SVG in report


bjarkekr

Recommended Posts

Hi.. Its not clear anywhere, but is it possible to use SVG in an image type? I have a logo that I would like to print on top of labels and the path is fetched from the database. It works fine with PNG, GIF or JPG, but not SVG...?

I have tried changing the "Expression Class" in I report to everything that is available with no luck.

Hope somebody can help.

 

Thanks

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello bjarkekr,

try this:

<image scaleImage="RetainShape" hAlign="Center" vAlign="Middle">
   <reportElement uuid="0eae3352-7e0c-40fe-a01a-1a3f72b030ac" x="0" y="37" width="195" height="38"/>
   <imageExpression><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("path/to/the.svg"))]]></imageExpression>
</image>

(tested with JasperReports v5.2.0 and iReport v5.1.0)

 

Also see:

http://community.jaspersoft.com/wiki/how-add-svg-image-your-report-jrxml

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