Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Label to span multiple cells/columns of table header
Migrateduser
Hi, how do I get a label to span multiple columns of a table header in the BIRT design API ?<br />
<br />
For example I want to do somethinglike this:<br />
<br />
<br />
<strong class='bbc'><pre class='_prettyXprint _lang-auto _linenums:0'>DataTitle DateColumns
colHdr1 colHdr2 colHdr3 colHdr4 date1 date2 date3 date4</pre></strong><br />
<br />
<br />
Thus there are 2 rows in the header.<br />
<br />
For simplicity sake I defined the header to have 2 rows with 8 columns corr. to the <br />
no. of columns in the 2nd header row.<br />
<br />
But I'd like DateColumns to span columns 5-6 and not get squeezed into column 5.<br />
<br />
Here's the code snippet I am using:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>for (int idx=0;idx<rowTexts.size();idx++)
{
RowText rowText=rowTexts.get(idx);
System.out.println("RowText=" + rowText);
LabelHandle label = elementFactory.newLabel("Label" + idx);
int startColNum=rowText.getStartColNum();
int colSpan=rowText.getColSpan();
String text=rowText.getText();
label.setText(text);
System.out.println("LBL Text=" + text);
CellHandle cell = (CellHandle) tblHdrRow.getCells().get(startColNum);
cell.setColumnSpan(colSpan);
cell.getContent().add(label);
}
</pre>
<br />
However this produces an invalid .rptdesign file.<br />
<br />
Any help would be greatly appreciated.
Find more posts tagged with
Comments
There are no comments yet