September 22, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Developing an Eclipse BIRT XML Report Rendering Extension

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

BIRT Report Engine provides report rendering extensions that render a report in HTML, PDF, XLS, PostScript, and Microsoft Word and PowerPoint. In BIRT release 2.2.1, the BIRT report rendering extension API supports rendering a report in a customized format, such as XML.

This article describes a sample implementation of customized XML report rendering extension, org.eclipse.birt.report.engine.emitter.xml. The sample code creates a plug-in that writes the data contents of a report to a file in the specified format.

A rendering extension adds an emitter to the BIRT Report Engine framework by implementing the extension point, org.eclipse.birt.report.engine.emitters. The XML schema file, org.eclipse.birt.report.engine/schema/emitters.exsd, describes this extension point.

The extension point enables support for a new output format in the presentation engine. The BIRT plug-in registry uses this extension point to discover all supported output formats specified for the report engine environment.

Developing an XML Report Rendering Extension



Click here for a larger image.

Figure 1: XML report rendering extension project

The sample XML report rendering extension is a plug-in that can export BIRT report data in XML format. Typically, report developers render BIRT report data to XML to enable sharing data with another application.

The sample XML report rendering extension contains the following features:

  • Exports BIRT report data in XML format
  • The XML report rendering plug-in renders each report element and writes to the output file, <report_name>.xml.
  • Defines a public API for rendering BIRT reports in XML format

    The plug-in extends the functionality defined by the org.eclipse.birt.report.engine.emitter extension point defined in the org.eclipse.birt.report.engine plug-in.

  • Allows the user to specify an XML schema for formatting output

    During the rendering process, the sample plug-in processes all the elements in the report design, exporting XML properties and related data to the output file. Optionally, the plug-in supports mapping the report elements to an XML schema to provide additional formatting for output.

    The plug-in defines these mappings in the property file, <report_name>.xmlemitter. The plug-in reads the property file at run time and loads the custom tags.

Creating a XML Report Rendering Plug-In Project

Create a new plug-in project for the XML report rendering extension using the Eclipse PDE.

How to create the XML report rendering plug-in project

  1. From the Eclipse PDE menu, choose File→New→Project.
  2. On New Project, select Plug-in Project.
  3. In Plug-in Project, modify the settings, as shown in Table 1.
  4. Table 1: Values for Plug-in Project fields

    Section Option Value
    Plug-in Project Project name org.eclipse.birt.report.engine.emitter.xml
      Use default location Selected
      Location Not available when you select Use default location
    Project Settings Create a Java project Selected
      Source folder src
      Output folder bin
    Target Platform Eclipse version 3.3
      an OSGi framework Not selected
  5. In Plug-in Content, modify the settings, as shown in Table 2.
  6. Table 2: Values for Plug-in Content fields

    Section Option Value
    Plug-in Properties Plug-in ID org.eclipse.birt.report .engine.emitter.xml
      Plug-in Version 1.0.0
      Plug-in Name BIRT XML Emitter
      Plug-in Provider yourCompany.com or leave blank
      Classpath xmlEmitter.jar or leave blank
    Plug-in Options Generate an activator, a Java class that controls the plug-in's life cycle Selected
      Activator org.eclipse.birt.report .engine.emitter.xml.XmlPlugin
      This plug-in will make contributions to the UI Not selected
    Rich Client Application Would you like to create a rich client application? No
  7. Choose Finish.

The XML report rendering extension project appears in the Eclipse PDE workbench, as shown in Figure 1.





Page 1 of 6



Comment and Contribute

 


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

 

 


Sitemap | Contact Us

Rocket Fuel