How to Develop an Application Using the Eclipse BIRT Design Engine API
Creating a customized report design application
Apr. 30, 2007 07:45 AM
This article is the second in a series on developing an application using Eclipse BIRT Engine APIs. It focuses on developing an application using the Eclipse BIRT Design Engine API. The last article focused on the Eclipse BIRT Report Engine API.
The Eclipse Business Intelligence Reporting Tool (BIRT) is a set of plug-in extensions that enable a developer to add reporting functionality to an application. BIRT provides a Design Engine API that a developer can use to create a customized report design application. The org.eclipse.birt.report.engine.api package contains a set of interfaces and implementation classes that supports integrating the design-time part of BIRT into a reporting application.
Programming with a Report Design
Sometimes business logic requires changes to the report design before generating the report. You can make some changes by using parameters and scripting. Other changes can only occur by modifying the report design itself.
A reporting application can make changes to the report design and the Report Object Model (ROM) elements that make up the design. To access the structure of the report design, the application obtains a ReportDesignHandle object from the design engine. To access the design engine, an application must first instantiate a report engine, as in any other reporting application.
The ReportDesignHandle object provides access to all properties of the report design and to the elements that the report design contains. The model API provides handle classes to access all ROM elements. For example, a GridHandle object provides access to a grid element in the report design. All ROM element handles, including the report design handle, inherit from DesignElementHandle. Report items inherit from ReportElementHandle and ReportItemHandle.
After making changes to a report design or its elements, the application can write the result to a stream or a file. The report engine can then open an IReportRunnable object on the resulting design and generate a report.
An application typically accesses the items in a report design to do one of the following tasks:
The functionality of a template is identical to a report design. For this reason, the ReportDesignHandle class provides access to a template. The LibraryHandle class provides access to a library. Both these classes derive from the ModuleHandle class, which provides the fields and methods for the common functionality, such as accessing elements in the file.
The package that contains the classes and interfaces to work with the items in a report design, library, or template is org.eclipse.birt.report.model.api.
BIRT Model API Capabilities
Modify a report item in a report design:
To access a report design and its contents, the application must instantiate a report engine then use a ReportDesignHandle object. You instantiate a ReportDesignHandle by calling a method on another class such as the model class, SessionHandle, or the report engine interface, IReportRunnable.
The SessionHandle object manages the state of all open report designs. Use a SessionHandle to open, close, and create report designs, and set global properties, such as the locale and the units of measure for report elements. The SessionHandle can open a report design from a file or a stream. Create the session handle only once. BIRT supports only a single SessionHandle for a user of a reporting application.
Configuring the Design Engine To Access a Design Handle
Create the SessionHandle object by calling the method, newSessionHandle( ) on the DesignHandle object. To open the report design, call the method, openDesign( ), on the SessionHandle object. This method takes the name of the report design as an argument and instantiates a ReportDesignHandle object.
Reader Feedback: Page 1 of 1
SOA World Latest Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
SYS-CON Featured Whitepapers
Most Read This Week