Home
Analytics
How to merge rows dynamically in grid or table in report
Elkaras
Hi..
I have a question ! ...
I design report in birt, use 3.7.2
I've searched as much as I can, but I don't know how to solve this ...
only I've found is how to merge cells ...not rows ...
[importPackage( Packages.org.eclipse.birt.report.model.api );
elementFactory = reportContext.getDesignHandle().getElementFactory()
var mytable = reportContext.getDesignHandle().findElement("mytable");
//get header and add label
var myheader = mytable.getHeader( ).get( 0 );
tcell = myheader.getCells( ).get( 1 ).drop();
tcell = myheader.getCells( ).get( 0 );
tcell.setColumnSpan(2);
tcell.setRowSpan(1);]
I thought it also works for detail rows...so I tried ..
but it works for only cols ...
like this
var mydetail = mytable.getDetail().get(0);
tcell = mydetail .getCells( ).get( 1 ).drop();
tcell = mydetail .getCells( ).get( 0 );
tcell.setColumnSpan(2);
tcell.setRowSpan(1);] //this for cols ..
and tried ..
var trow1 = mydetail . getRows(). get(0);
var trow2 = mydetail . getRows(). get(1);
trow2..getCells( ).get( 0 ).drop();
var tcell2 = trow2..getCells( ).get( 0 );
tcell2.setRowSpan(2);...
but dosen't work...:(
I wnat to do this cause ..
there is data has same values ..as group header...
that my thought of design report is ..
I attached image file ..
if there is a way, plz let me know ...
or other way ..like using group table ..? or something .. ...? ..
Find more posts tagged with
Comments
mwilliams
Can you try attaching the image file of what you're trying to do, again? I don't see it. Can you also create a report with the sample database showing what you're trying to do? This way I can run it and see what you're seeing? Thanks!
xiaolovebirt
<p><sub class='bbc'>have you solven this problem, i have the same question, if you solve it ,can you share it ? or can i have your email, i need your help. thank you.</sub></p>
xiaolovebirt
<p>hi , have you resolve this problem, i encounter the same question, so ,can you share it ?</p><p>thank you.</p>