BIRT Exchange Forum: Can BIRT template accept images from an XML datasource - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can BIRT template accept images from an XML datasource Rate Topic: -----

#1 User is offline   JOEJOEJOE Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 21-June 12


Posted 21 June 2012 - 01:39 AM

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

#2 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 21 June 2012 - 11:32 AM

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.blo...eport-item.html

Jason

Attached File(s)


0

#3 User is offline   JOEJOEJOE Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 21-June 12


Posted 21 June 2012 - 05:10 PM

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
0

#4 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 22 June 2012 - 11:32 AM

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
0

#5 User is offline   JOEJOEJOE Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 21-June 12


Posted 24 June 2012 - 12:12 AM

View PostJasonW, on 22 June 2012 - 12:32 PM, said:

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



Hi Jason,
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.
'The resource of this report item is not reachable'

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.

Thanks for your kind help.

Attached File(s)


0

#6 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 25 June 2012 - 01:45 PM

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

Attached File(s)


0

#7 User is offline   actuser9 Icon

  • Senior Member
  • Group: Members
  • Posts: 107
  • Joined: 11-April 12


Posted 07 July 2012 - 11:44 AM

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
0

#8 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 11 July 2012 - 02:00 PM

Take a look at the attached example.

Jason

Attached File(s)


0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users