Home
Analytics
SVG image in birt report
IlyaL
<p>Hi everyone! Maybe someone knows is it possible add svg( image) in birt report? If yes, how to do this? </p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>The Image component in BIRT supports the SVG format, as shown here:</p>
<p> </p>
<p> </p>
<p>P.</p>
IlyaL
<p>Thank you for answer, but it's not work for me(my fault, question wasn't correct), because i must to transfer my report via proxy to another server which works with clients. And i can't use base64.</p>
<p>So the only way which i see is to include svg in html as is. Is it possible?</p>
pricher
<p>Hi,</p>
<p> </p>
<p>Two possible ways:</p>
<p> </p>
<p>1. In the image component, select the image from URI:</p>
<p>
IlyaL
<p>No, i mean is it possible to insert <svg></svg> directly in html(report), like tag, for example, <body>?</p>
<p> </p>
<p>PS. last solution not works for me, because, i can't get to server(from "manager's server") which produce reports</p>
pricher
<p>From what I can understand of your requirements, you can probably use an Image element and point it to an embedded image. An embedded image is an image that will be added in your report design as a binary element. When you run or view the report, since the image is part of the report, there will be no need to retrieve it from a remote server. Here's a screenshot of how you add en embedded image in a report:</p>
<p>
IlyaL
<p>Ok, i can't use <svg> directly in the report, is there any way to include it using Java?</p>
pricher
<p>Unfortunately, I am unable to help you further here. I suggest you post to a new thread to see if someone else can answer. And this time, you should provide more background on the business case as sometimes it helps find solutions.</p>
Clement Wong
<p>
@IlyaL
, please provide more information such as the high-level requirements of you application and the setup that might be different from a vanilla BIRT Engine deployment.</p>
<p> </p>
<p>You can also refer to this technique of adding SVG via DOM insertion I posted recently:</p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/38997-svg-image/?p=142767'>http://developer.actuate.com/community/forum/index.php?/topic/38997-svg-image/?p=142767</a></p>
;
IlyaL
<p>Clement, i followed your refer, and after some tricks it works: Here is solution which works for me:</p>
<pre class="_prettyXprint _lang-html">
<div id="logo"/>
<script>
document.getElementById('logo').innerHTML = '<div><svg>svg's code</svg></div>'
</script> </pre>
<p>So, Pierre, Clement, thank you for your help and time!
</p>