Programming using the BIRT Reporting APIs : Programming the structure of a report design : Using a report item in a report design : How to access a report item by name
 
How to access a report item by name
The code sample in Listing 12‑17 finds an image item by name, checks its type, and examines its URI. The variable, design, is a ReportDesignHandle object.
Listing 12‑17 Finding a report item having a given name
DesignElementHandle logoImage = design.findElement( "Company Logo" );
// Check for the existence of the report item.
if ( logoImage == null) {
return null;
}
// Check that the report item has the expected class.
if ( !( logoImage instanceof ImageHandle ) ) {
return null;
}
// Retrieve the URI of the image.
String imageURI = ( (ImageHandle ) logoImage ).getURI( );
return imageURI;