Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Creating Hierarchy Table
Rags
Hi All,
Am designing a table which represent the child-ancestor hierarchy. I need the code to access and create a col/row in a table dynamically through java.
// here am initializing the IDesignEngine and IReportEngine. creating new session handle for IDesignEngine.
ReportDesignHandle rdHandle = getReportDesignHandle("file path here");
ElementFactory elementFactory = rdHandle.getElementFactory();
TableHandle tHandle = elementFactory.newTableItem("PedigreeHierarchyTable", col,0,row,0);
for (int i = 0; i < ((RowHandle)tHandle.getDetail().get(i)).getCells().getCount(); i++) {
int rowCell = ((RowHandle)tHandle.getDetail().get(i)).getCells().getCount();
LabelHandle textLabel1 = elementFactory.newLabel("Ecma_"+i);
textLabel1.setText("Raghu");
CellHandle cell1 = (CellHandle) rowHandle.getCells().get(0);
cell1.getContent().add(textLabel1);
By doing this am able to add a string to the first rows of a table. What i need is:
1. How to add the string to all the rows.
2. How to add the string to all the columns.
3. How to access the string and change it in all the rows.
4. How to access the string and change it in all the columns.
Thanks in advance,
Rags
Find more posts tagged with
Comments
Rags
Hi All,
I had found a cumbersome half way not leading anywhere. I found a simple way out just thought to share:
TableHandle tHandle = elementFactory.newTableItem( "PedigreeHierarchyTable", col, 0, row, 0);
for (int i = 0; i < tHandle.getLayoutModel().getRowCount(); i++) {
RowHandle rowHandle = (RowHandle) tHandle.getDetail().get(i);
for (int j = 0; j < tHandle.getLayoutModel().getColumnCount(); j++) {
LabelHandle textLabel1 = elementFactory.newLabel("Ecma_" + i + j);
textLabel1.setText("Raghu");
CellHandle cell1 = (CellHandle) rowHandle.getCells().get(j);
cell1.getContent().add(textLabel1);
}
}
Regards,
Rags