Home
Analytics
How to display an image embedded into an XLM datasource ?
miaou_
Hi everybody,
first of all, I apologize for my poor english level ^^
I am trying to display an image (png in my example) which is base64-encoded into the xml datasource.
As you may see in the attachment sample, I cannot see my image into the output html result (nor into the other formats too). cf. attachment birt_preview.png, the second column is my xml image, the third one contains the same image embedded into the rptdesign
Can anybody look at my sample and show me any mistakes I made ?
Thanks a lot to take time to answer me.
Nicolas
notes :
* I am using birt rcp version 2.5.0 / jdk : 1.5.0.
* you probably have to modify the xml file path into the dataSource xmlDataSrc. it must point to the downloaded embeddedXmlImage.xml.
* The code used to decode the base64-encoded data is
importClass(Packages.org.apache.commons.codec.binary.Base64);
Base64.decodeBase64(row["ImageData"]);
You have to put the commons-codec-1.4.jar in your path to make it work (or into birt_rcp_install_dir/plugins, it will work too).
Find more posts tagged with
Comments
mwilliams
Hi miaou,
I've tried several different things with no success so far. What code was used to encode the image data?
miaou_
Arg, oups, shame on me !!
You're right, my base64-encoding string is wrong.
Sorry to have bothered you...
Virgil Dodson
Here in another way of showing a base64 encoded image