Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to get all Images in Report and there datasets
How to get all Images in Report and there datasets [message #998603] Thu, 10 January 2013 10:35 Go to next message
Thomas P. is currently offline Thomas P.Friend
Messages: 20
Registered: April 2012
Junior Member
Hello,

i want to get the datasetname used by an Image for all images in a Reportdesign.

In a Report a Image Tag has a property for the dataset-name.
This value I need for every Image in the Report.

        
<image id="663">
   <property name="height">218px</property>
   <property name="width">366px</property>
   <property name="dataSet">ChartDataset</property>


Then I tried to get the Dataset definied by the Image. But everything I try brings me only the List of embeeded Images in the Report, not the Image Elements in the Report.


final IReportRunnable design = [...]
final ReportDesignHandle reportDesignHandle = (ReportDesignHandle) design.getDesignHandle();

List allImages = reportDesignHandle.getAllImages();
for (Object o : allImages) {
if (o instanceof EmbeddedImageHandle) {
  EmbeddedImageHandle h = (EmbeddedImageHandle)o;
  String name = h.getName();
  [...]
}


How can I get the Datasetname per definied Dynamic Image in the Report.

(Birt 3.7.1)


Thomas
Re: How to get all Images in Report and there datasets [message #998612 is a reply to message #998603] Thu, 10 January 2013 10:53 Go to previous messageGo to next message
Thomas P. is currently offline Thomas P.Friend
Messages: 20
Registered: April 2012
Junior Member
I found the answer

[...]
SlotHandle body = reportDesignHandle.getBody();
List contents = body.getContents();
for (Object o : contents) {
  if (o instanceof ImageHandle) {
    ImageHandle handle = (ImageHandle)o;
    Object property = handle.getProperty( "dataSet" );
  }
}


Thomas
Re: How to get all Images in Report and there datasets [message #998844 is a reply to message #998612] Thu, 10 January 2013 20:07 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1663
Registered: July 2009
Senior Member

Glad you found a solution. Thanks for updating the thread!

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:How to call BIRT Report in JSP Page
Next Topic:Property binding and dynamic paramaters
Goto Forum:
  


Current Time: Wed Nov 26 11:30:59 GMT 2014

Powered by FUDForum. Page generated in 0.02124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software