Add rows dynamically to Grid [via script]

Options
system_migrated
edited February 11, 2022 in Analytics #1
<p>Hello</p><p> </p><p>I am trying to create a birt report that is generated dynamically based on certain data. The report has the following structure.</p><p> </p><p>Body</p><p style="margin-left:40px;">Grid - main</p><p style="margin-left:80px;">Grid - data_grid</p><p style="margin-left:80px;"> </p><p>I am trying to dynamically add rows to the data_grid. Researching, I managed to piece together this code, which i put in the on create method of the main- Grid (of which its not working). Please could you assist.</p><p> </p><div><pre class="_prettyXprint">importPackage (Packages.org.eclipse.birt.report.model.api);grid = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("data_grid");elementFactory = reportContext.getReportRunnable().designHandle.getElementFactory();rowParm = new RowOperationParameters(2,-1,1);grid.insertRow(rowParm);tblCell = grid.getCell(1,0);label = elementFactory.newLabel("tblCell");label.setText("Startdate");tblCell.getContent().add(label);</pre></div><p> </p>

Comments

  • <p>Try doing this in the beforeFactory or onPrepare methods.</p>
    Warning No formatter is installed for the format ipb