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)
How I can add new row in table through javascript
_Petr
Hi All,<br />
I have empty report. I create new table in report through JavaScript as follows<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
elementFactory = reportContext.getReportRunnable().designHandle.getElementFactory();
var num = 10;
dynamicTable = elementFactory.newTableItem("myNewTable", num);
dynamicTable.setWidth("100%");
myNewRow = dynamicTable.getDetail().get(0);
for (var i=0;i!=num;++i) {
firstCell = myNewRow.getCells().get(i);
label = elementFactory.newLabel(null);
label.setText("Header_" + 1);
firstCell.getContent().add(label);
}
reportContext.getReportRunnable().designHandle.getBody().add(dynamicTable);
</pre>
I can add new cell in header, but I also want add new row without use DataSet. How I can do it? <br />
Thanks.
Find more posts tagged with
Comments
mwilliams
Hi _Petr,
Take a look at this past forum thread:
http://www.birt-exchange.org/org/forum/index.php/topic/16624-how-to-add-a-detail-row-to-tablehandle/
Hope it helps.