October 22, 2016
Hot Topics:

Developing an Eclipse BIRT XML Report Rendering Extension

  • March 6, 2008
  • By Jason Weathersby, Iana Chatalbasheva, and Tom Bondur
  • Send Email »
  • More Articles »

Listing 10 shows the values of the patterns for the XML version, text, image, data, label, and report tags specified in the XML Schema file.

Listing 10: The XML Schema file

start=<?xml version="1.0" encoding="UTF-8"?>
report=<report name=??name>
label=<label name=??name hyperlink=??hyperlink>??value</label>
text=<text name=??name>??value</text>
image=<image name=??name>??value</image>

Testing the XML report rendering plug-in

To test the XML report rendering example, create a Java application that runs a report design in an installation of the BIRT run-time engine, similar to application created to run the CSV report rendering example.

To test the XML report rendering plug-in, perform the following tasks:

  • Build the org.eclipse.birt.report.engine.emitter.xml plug-in.
  • Deploy the plug-in to the BIRT run-time engine directory.
  • Launch a run-time instance of the Eclipse PDE.
  • Create a Java application that runs the report design and writes the report's data to an XML file.
  • Create a report design containing a table that maps to a data source and data set.
  • Run the application and examine the XML in the output file.

Figure 2 shows the report design used in the XML report rendering example.

Figure 2: Report design for the XML report rendering example

Listing 11 shows the contents of the XML output file, containing XML version, text, image, data, label, and report tags for an executed report.

Listing 11: Contents of the XML output file

<?xml version="1.0" encoding="UTF-8"?>
<report name=
   <image name=>
      name= hyperlink=http://www.actuate.com>Company Name
   <label name= hyperlink=>Report</label>
   <label name= hyperlink=>PRODUCTNAME</label>
   <label name= hyperlink=>QUANTITYINSTOCK</label>
   <label name= hyperlink=>MSRP</label>
   <data>1969 Harley Davidson Ultimate Chopper</data>
   <data>1952 Alpine Renault 1300</data>
   <data>1996 Moto Guzzi 1100i</data>
   <data>2003 Harley-Davidson Eagle Drag Bike</data>
   <data>American Airlines: MD-11S</data>
   <data>Boeing X-32A JSF</data>
   <data>Pont Yacht</data>

About the Book Excerpt

This article is an excerpt from the book, Integrating and Extending BIRT, by Jason Weathersby, Don French, Tom Bondur, Jane Tatchell, and Iana Chatalbasheva, published by Addison-Wesley. The book is the second volume in a two-book series about business intelligence and reporting technology. The book introduces programmers to BIRT architecture and the reporting framework. It shows programmers how to build and deploy customized reports using scripting and BIRT APIs. It also describes how to use key extension points to create customized report items, rendering extensions for generating output other than HTML or PDF, and Open Data Access (ODA) drivers for new data sources.

About the Authors

The authors, Jason Weathersby, Iana Chatalbasheva, and Tom Bondur, are members of the extended BIRT development team and all have backgrounds in both computer science and technical writing. Collectively, they have many years experience in technical consulting, training, writing, and publishing about reporting, business intelligence tools, and database technologies.

About BIRT Exchange

Additional helpful resources related to BIRT are avaliable at BIRT Exchange http://www.birt-exchange.com, a community site for developers who need to build reporting into applications. BIRT Exchange offers downloads, online documentation, forums, and other resources that let developers share technical tips, code snippets, and ideas.

Page 6 of 6

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel