| By Jason Weathersby, Tom Bondur, Jane Tatchell | Article Rating: |
|
| April 30, 2007 07:45 AM EDT | Reads: |
49,259 |
Using an IReportRunnable Object To Access a Design Handle
You can also open a report design from an IReportRunnable object by
using the getDesignHandle( ) method. The ReportDesignHandle object
provides access to the design opened by the report engine. Changes to
the report design do not affect the IReportRunnable object. To generate
a report from the changed report design, you must reopen the design as
an IReportRunnable object.
How To Open a Report Design for Editing
The code sample in Listing 1
creates a DesignEngine object that it uses to create a SessionHandle
object. The code then uses the SessionHandle object to open a report
design.
Using a Report Item in a Report Design
A report
item is a visual element in the report design. Typically, a report
developer adds a report item to the design in the BIRT Report Designer
by dragging an item from the palette to the layout editor. Sometimes
you have to change the properties of certain report items in the design
before running the report. An application uses methods on the
ReportDesignHandle class to access a report item either by name or from
a list of items in a slot in a container report item.
A slot is a logical component of a report item. For example, a table element has five slots: Header, Detail, Footer, Groups, and Columns. In turn, each of these slots can have further slots. Each slot has zero or more members of the appropriate report item type. For example, the Header, Detail, and Footer slots all contain elements of the RowHandle type. RowHandle has a Cell slot that contains all the cells in the row. For a visual representation of the slots in an individual report item, see the Outline view in BIRT Report Designer.
Accessing a Report Item by Name
To make a report
item accessible by name, the item must have a name. A report developer
can set the name in BIRT Report Designer or programmatically by using
the item's setName( ) method. To find a report item by name, use the
findElement( ) method. This method returns a DesignElementHandle
object. All report items derive from this class.
Accessing a Report Item by Iterating through a Slot
To access a report item through the report design's structure, the
application first gets the slot handle of the report body by calling
the getBody( ) method. This slot handle holds the top-level report
items in the report design. For example, consider a simple report
structure that has three top-level items: a grid containing header
information, a table containing data, and a label that displays a
report footer. Figure 1 shows its outline view in BIRT Report Designer.
To access the top-level items in this report design, you iterate over the contents of the body slot handle. These contents all derive from DesignElementHandle. To access the iterator for a slot handle, call SlotHandle.iterator. Each call to Iterator.getNext( ) returns a report item. Alternatively, to access a report item at a known slot index, call SlotHandle.get(). The slot index number is zero-based. The ReportDesignHandle class also provides finder methods, which can access an item or other report element by name.
Published April 30, 2007 Reads 49,259
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.
- IBM Puts Systems Chief on Leave of Absence
- Amazon Web Services Database in the Cloud
- SpringSource Moving to Spring 3.0
- Virtualization Expo Call for Papers Deadline December 15
- Move Over BI, Here Comes PI - Performance Intelligence
- Using Ext JS, Servlets, JSON, MySQL and Tomcat on Fedora
- Qt DevDays 2009 - Munich
- Developing APIs for the Cloud
- Canonical Offers Free Cloudware
- New-Generation Virtualization Technologies with Ultra Low-Cost Endpoints
- The Planet Executive to Speak at Cloud Computing Conference
- Trusting the Cloud
- Oracle-Sun: IBM Reportedly Behind Delay
- The Case for Single-Purpose Services
- IBM Puts Systems Chief on Leave of Absence
- Cloud BI & Amazon VPC
- Cloud-Oriented Switch Start-up Valued at $230M
- The Curious Case of Build Release Management eBook
- Amazon Web Services Database in the Cloud
- Tips for Efficient PaaS Application Design
- Reporting Solutions Using Crystal Reports for Eclipse
- SpringSource Moving to Spring 3.0
- Virtualization Expo Call for Papers Deadline December 15
- Un-Clouding Federal Security Compliance
- 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
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- How to Bring Eclipse 3.1, J2SE 5.0, and Tomcat 5.0 Together
- SYS-CON Webcast: Eclipse IDE for Students, Useful Eclipse Tips & Tricks
- Eclipse: The Story of Web Tools Platform 0.7
- "Eclipse 3.0 is a Great Leap Forward," Says JDJ's Dudney
- Developing an Eclipse BIRT Report Item Extension
- The Top 250 Players in the Cloud Computing Ecosystem




























