print image base64 in birt report
Comments
-
<a class='bbc_url' href='http://www.birt-exchange.org/org/devshare/designing-birt-reports/1377-inline-base64-image-in-html-output/'>Take a look at this devshare</a>. It shows how to encode an image as base64 then display it. Since it sounds like you've already got the image stored in your db as base64 you should be able to skip the encoding and use the second part of the script to display the image.Warning No formatter is installed for the format ipb0
-
thanks for your reply
I not understand for that code
var myurl = URL("http://tomcat.apache.org/images/tomcat.gif");
var img = ImageIO.read(myurl);
bas = new ByteArrayOutputStream();
ImageIO.write(img, "gif", bas);
bas.flush();
encodedimga = Base64.encodeBase64(bas.toByteArray());
encodedimg = new String( encodedimga, "utf-8");
bas.close();
imgsrc = "data:image/gif;base64,"+encodedimg+"\"";
the first 1, it encode the image to binary.
but, i already have 64binary code...
so, can skip it
but the second one, what the value for bas?
i try replace it as
this.getRowData().getColumnValue("B_CONTENT") // b_content is my column
but can't work0 -
nevermind,
I have a solution about that
just use the text only..
<value-of format="HTML">
if(row["B_CONTENT"] == null) {"";}else{
"<img src='data:image/png;base64,"}</value-of><value-of format="HTML"> row["B_CONTENT"]</value-of><value-of format="HTML">
if(row["B_CONTENT"] == null ) {"";}else{"' height='120' width='100' />"}
</value-of>
tq0 -
I'm new in BIRT using and i would like to ask you ,Where should i write this text ?
@azhar3001 said:
nevermind,
I have a solution about that
just use the text only..
if(row["B_CONTENT"] == null) {"";}else{
" row["B_CONTENT"]
if(row["B_CONTENT"] == null ) {"";}else{"' height='120' width='100' />"}0 -
I am not familiar with this example, but the
tags typically are entered in a Text element. Add a Text element from the Palette to a table cell, change its type to "HTML" in the editor, and enter the code. The JavaScript will run as normal and the data (i.e. row["B_CONTENT"]) will automatically be filled in with the data value for the column specified for each row that is generated. Warning No formatter is installed for the format ipb0
Categories
- All Categories
- 117 Developer Announcements
- 52 Articles
- 145 General Questions
- 133 Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 912 Cloud Fax and Notifications
- 81 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 167 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 4 XM Fax