Skip to main content



      Home
Home » Archived » BIRT » Table get Group by script
Table get Group by script [message #1016693] Thu, 07 March 2013 06:27 Go to next message
Eclipse UserFriend
Hi All,
there is a possibility to get a certain cell of a certain Group header?
Thanks
Re: Table get Group by script [message #1016722 is a reply to message #1016693] Thu, 07 March 2013 08:35 Go to previous messageGo to next message
Eclipse UserFriend
I found this code to get group...but i would change bakgroundcolor for a certain cell of the header of this groups:
importPackage( Packages.org.eclipse.birt.report.model.api );
elementFactory = reportContext.getDesignHandle().getElementFactory()

var mytable = reportContext.getDesignHandle().findElement("tableDetail");
var group= mytable.getGroups().get(2); //2 is the position of my group


but this returns me an error:
var aCell= group.getHeader().getCells().get(7);

what is wrong?
Thanks
Re: Table get Group by script [message #1016743 is a reply to message #1016693] Thu, 07 March 2013 09:24 Go to previous messageGo to next message
Eclipse UserFriend
I use this code:
importPackage( Packages.org.eclipse.birt.report.model.api );
elementFactory = reportContext.getDesignHandle().getElementFactory()

var mytable = reportContext.getDesignHandle().findElement("tableDetail");
var group= mytable.getGroups().get(2);
var rGH= group.getHeader().get(0);
var aCell = rGH.getCells().get(6);


but i am in doubt about this:
var rGH= group.getHeader().get(0);


I take the correct object? ( Sad seems no )
Re: Table get Group by script [message #1016882 is a reply to message #1016743] Thu, 07 March 2013 22:31 Go to previous message
Eclipse UserFriend
I am not sure what you are doing with the code but you can get the data item in the first cell of a group header like:
//name your table
var tableHandle = reportContext.getDesignHandle().findElement("mytable");
//get the first group with getGroups().get(0)
//get the first group header row with getHeader().get(0)
//get the first cell with getCells().get(0)
//Get the first element in the cell with getContent().get(0);
tableHandle.getGroups().get(0).getHeader().get(0).getCells().get(0).getContent().get(0);

Jason
Previous Topic:data extraction vs emitter
Next Topic:Text Rotation
Goto Forum:
  


Current Time: Sat Apr 26 03:32:26 EDT 2025

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

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

Back to the top