| By Jason Weathersby, Tom Bondur, Jane Tatchell | Article Rating: |
|
| April 30, 2007 07:45 AM EDT | Reads: |
62,635 |
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
A reporting application typically generates a report from a report design. In this type of reporting application, you develop a report design and include the design along with the application at deployment. Any changes to the generated report depend on the values of report parameters and the data from the data set. To access the report design, the application uses an IReportRunnable object.
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:
- Modify an existing report design programmatically to change the contents and appearance of the report output. An application can modify page characteristics, grids, tables, and other report items in the design, the data source, and the data set that extracts data from a data source.
- Build a report design and generate report output entirely in an application without using BIRT Report Designer.
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
A report developer can write an application that creates and modifies a report design programmatically. The BIRT model API has the same capabilities as BIRT Report Designer. For example, the following list shows some of the ways in which you can use the BIRT model API to manipulate a report design programmatically:
Modify a report item in a report design:
- Format a report item, change the font, font color, fill color, format, alignment, or size. Modify the expression or other property of a report item.
- Change the data set bound to a table or list.
Add a report item to a report design:
- Add a simple report item such as a data item, label, or image.
- Set the value to display in the new report item, such as the expression of a data item or the text in a label item.
- Create a complex item such as a grid, table, or list.
- Add other items into a grid, table, or list.
Change the structure of a report design:
- Add or delete a group or column in a table or list.
- Add a report parameter.
Modify non-visual elements in a report design:
- Specify a data source for a data set.
- Set a design property such as a report title, author, wallpaper, or comment.
- Set a page property such as height, width, or margins.
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
The DesignEngine class provides access to all the functionality of the ROM in the same way that the ReportEngine class provides access to report generation functionality. To create a DesignEngine object, you first create a DesignConfig object to contain configuration settings for the design engine. The DesignConfig object sets up custom access to resources and custom configuration variables for scripting. Instantiate a DesignEngine object with the DesignConfig object as an argument to the constructor.
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.
Published April 30, 2007 Reads 62,635
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Jason Weathersby
Jason Weathersby is a member of the extended BIRT development team at Actuate Corporation and has backgrounds in both computer science and technical writing. He has many years experience in technical consulting, training, writing, and publishing about reporting, business intelligence tools, and database technologies.
More Stories By Tom Bondur
Tom Bondur is a member of the extended BIRT development team at Actuate Corporation and has backgrounds in both computer science and technical writing. He has many years experience in technical consulting, training, writing, and publishing about reporting, business intelligence tools, and database technologies.
More Stories By Jane Tatchell
Jane Tatchell is a content development manager in the Developer Communications group of Actuate Engineering.
- Cloud People: A Who's Who of Cloud Computing
- Session Topics: 12th Cloud Expo / Cloud Expo New York
- CollabNet And UC4 Announce General Availability Of Joint Enterprise DevOps Platform
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- The Software Freedom Conservancy – Fundraising Campaign: Non-Profit Accounting Software
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Project Floodlight Grows to the World’s Largest SDN Ecosystem; Global Users, Contributors and Partners Innovating Using Open Source SDN
- Mobility News Weekly – Week of March 17, 2013
- Midokura Announces General Availability of Disruptive Network Virtualization Technology
- Remote Controlling a Car over the Web. Ingredients: Smartphone, WebSocket, and Raspberry Pi.
- Social Business Intelligence Book Industry’s First Executive SBI Guide
- The Linux Foundation’s Collaboration – OpenDaylight Project – Open Source SDN
- Cloud People: A Who's Who of Cloud Computing
- SUSE Receives Common Criteria Security Certifications
- Basho Announces Open Source Riak CS and General Availability of Riak CS Enterprise v1.3
- Session Topics: 12th Cloud Expo / Cloud Expo New York
- CollabNet And UC4 Announce General Availability Of Joint Enterprise DevOps Platform
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- The Software Freedom Conservancy – Fundraising Campaign: Non-Profit Accounting Software
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Project Floodlight Grows to the World’s Largest SDN Ecosystem; Global Users, Contributors and Partners Innovating Using Open Source SDN
- Antenna to "Myth-Bust" Common Mobile App Development Misconceptions in Upcoming Webinar
- Mobility News Weekly – Week of March 17, 2013
- Global Information Security Products And Services Industry
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- Creating Web Applications with the Eclipse Web Tools Project
- Eclipse Special: Remote Debugging Tomcat & JBoss Apps with Eclipse
- Where Are RIA Technologies Headed in 2008?
- The Next Programming Models, RIAs and Composite Applications
- SYS-CON Webcast: Eclipse IDE for Students, Useful Eclipse Tips & Tricks
- How to Bring Eclipse 3.1, J2SE 5.0, and Tomcat 5.0 Together
- Eclipse: The Story of Web Tools Platform 0.7
- The Top 250 Players in the Cloud Computing Ecosystem
- "Eclipse 3.0 is a Great Leap Forward," Says JDJ's Dudney
- Developing an Eclipse BIRT Report Item Extension


























