Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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: 25
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: 25
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: 1925
Registered: July 2009
Senior Member

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

Michael

Developer Evangelist, Silanis
Previous Topic:How to call BIRT Report in JSP Page
Next Topic:Property binding and dynamic paramaters
Goto Forum:
  


Current Time: Fri Apr 26 03:56:53 GMT 2024

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

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

Back to the top