Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Table get Group by script
Table get Group by script [message #1016693] Thu, 07 March 2013 11:27 Go to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
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 13:35 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
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 14:24 Go to previous messageGo to next message
Mimmo Rossi is currently offline Mimmo RossiFriend
Messages: 135
Registered: February 2013
Senior Member
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] Fri, 08 March 2013 03:31 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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: Thu Nov 20 21:09:57 GMT 2014

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

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