Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Can BIRT template accept images from an XML datasource
JOEJOEJOE
I am new to BIRT . I have a requirement to generate PDF documents with multiple images within it. The system which am building will receive XML message (which has got images within it ..the number of images in the xml can vary) from a client application. Based on the number of images in the supplied XML , I need to generate a single PDF document (the generated PDF should include all the supplied images). Can I use BIRT template to generate my PDF ?...Can BIRT template be configured in a way so that it will accept dynamic images from an XML datasource.
What are the options available to me ?. Is BIRT the right solution for me ?.
My BIRT Report designer version is 2.5.2
Gurus , please help ... I tried may tutes online , but so far no luck...
Find more posts tagged with
Comments
JasonW
Yes birt can handle this using a bit of script. Look at the attached example that reads a base64 encoded image from a csv file. It could have easily been an xml file.
You also may want to read over this:
http://birtworld.blogspot.com/2010/09/birt-image-report-item.html
Jason
JOEJOEJOE
Jason, thanks a lot for your quick reply.
I tried to run the sample code you gave me , but i couldn't see the image in the generated PDF. Not sure what was wrong.
Have you got any examples where the image is read from an XML file and shown as PDF..
Thanks for your kind help
JasonW
Did you try to open the report in the designer? Did you change the location in the design for the csv file? If you have an example xml file with an image in it, I can write you an example.
Jason
JOEJOEJOE
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="105138" data-time="1340393540" data-date="22 June 2012 - 12:32 PM"><p>
Did you try to open the report in the designer? Did you change the location in the design for the csv file? If you have an example xml file with an image in it, I can write you an example.<br />
<br />
Jason<br /></p></blockquote>
<br />
<br />
Hi Jason, <br />
I accessed the BIRT template you gave me and modified the location in the design for the CSV file. But it didn't work. I was getting the following text on the PDF where the image should have appeared.<br />
<em class='bbc'>'The resource of this report item is not reachable'</em><br />
<br />
I created a fresh new template to work from an XML data source; but it didn't work. I am attaching the XML file and the BIRT template that I created. <br />
<br />
Thanks for your kind help.
JasonW
I modified your example to use apache b64 calls. It works for me. I am attaching the modified example. Open it in your designer and change the xml source location. Run it in the designer and see if it works. How are you generating the pdf, with code?
Jason
actuser9
Hi Jason,
It is very interesting how you got the image file from the xml data source.
Do you have an example of getting the image from a scripted data source based on a java object? My report requirement is something like this.
1. Generate the scripted data set in the report based on a java pojo object.
2. The images are to be flown into the report by means of a dynamic image from the scripted data set which has a image colunm of blob type to retrieve the byte information from the java object.
3. The byte information needs to be retrieved in the report and eventually the image should be populated.
Being new to Java & Actuate, I am facing issues with both the blob type declaration in the java class and then retrieving it from the object into the scripted data set. Data column information is flowing through but not the image byte information.
Can you please help me with this?
Regards,
UY
JasonW
Take a look at the attached example.
Jason