So I'm trying to implement dynamic reports. (using Birt 2.6.2) I have a saved report on disk which contains a table containing X number of row details, and I'm trying to edit the table to add more row details.<br />
<br />
I've found a thread with an example: <a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/16624-how-to-add-a-detail-row-to-tablehandle/#post53870'>http://www.birt-exchange.org/org/forum/index.php/topic/16624-how-to-add-a-detail-row-to-tablehandle/#post53870</a><br />
<blockquote class='ipsBlockquote' ><p>rowParm = new RowOperationParameters(2, -1, 1);<br />
table.insertRow(rowParm);<br /></p></blockquote>
<br />
but when I try it, I get different exceptions depending on the RowOptionParameters parameters. <br />
<br />
My table has 1 (empty) detail row. <br />
<br />
I do: table.insertRow(new RowOperationParameters(1, -1, 0));:<br />
<br />
<em class='bbc'><span style='font-size: 8px;'>org.eclipse.birt.report.model.api.command.ContentException: The Row is not allowed in the slot (Groups) of Table("myTable").<br />
at org.eclipse.birt.report.model.util.ContentExceptionFactory.createContentException(ContentExceptionFactory.java:43)<br />
at org.eclipse.birt.report.model.command.AbstractContentCommand.checkBeforeAdd(AbstractContentCommand.java:188)<br />
at org.eclipse.birt.report.model.command.ContentCommand.checkBeforeAdd(ContentCommand.java:164)<br />
at org.eclipse.birt.report.model.command.AbstractContentCommand.add(AbstractContentCommand.java:149)<br />
at org.eclipse.birt.report.model.api.SlotHandle.add(SlotHandle.java:152)<br />
at org.eclipse.birt.report.model.api.SlotHandle.add(SlotHandle.java:102)<br />
at org.eclipse.birt.report.model.api.SlotHandle.paste(SlotHandle.java:222)<br />
at org.eclipse.birt.report.model.api.RowBandInsertAction.doInsert(RowBandInsertAction.java:113)<br />
at org.eclipse.birt.report.model.api.TableHandle.insertRow(TableHandle.java:442)<br />
at x.BirtReportManager.updateTableInfoReport(BirtReportManager.java:540)<br />
at x.BirtReportManager.updateReport(BirtReportManager.java:238)<br />
at x.BirtReportManager.main(BirtReportManager.java:118)</span><br />
</em><br />
<br />
<br />
I do: table.insertRow(new RowOperationParameters(1, -1, 1));:<br />
<br />
<em class='bbc'><span style='font-size: 8px;'>org.eclipse.birt.report.model.api.elements.SemanticError: The insert operation on the element "myTable" is forbidden.<br />
at org.eclipse.birt.report.model.api.RowBandInsertAction.doInsert(RowBandInsertAction.java:101)<br />
at org.eclipse.birt.report.model.api.TableHandle.insertRow(TableHandle.java:442)<br />
at x.BirtReportManager.updateTableInfoReport(BirtReportManager.java:540)<br />
at x.BirtReportManager.updateReport(BirtReportManager.java:238)<br />
at x.BirtReportManager.main(BirtReportManager.java:118)</span></em><br />
<br />
The slotId param seems to be fine because if I replace it with a 0 or 2, I get Array out of bounds exceptions:<br />
<br />
<em class='bbc'><span style='font-size: 8px;'>java.lang.IndexOutOfBoundsException: Index: 1, Size: 1<br />
at java.util.ArrayList.RangeCheck(Unknown Source)<br />
at java.util.ArrayList.get(Unknown Source)<br />
at x.BirtReportManager.updateTableInfoReport(BirtReportManager.java:542)<br />
at x.BirtReportManager.updateReport(BirtReportManager.java:238)<br />
at x.BirtReportManager.main(BirtReportManager.java:118)</span></em><br />
<br />
<br />
I've seen another topic with the same error, but this isn't at runtime at all... Any idea of what could be wrong? I can add columns to the table, but I can't seem to be able to add row details...<br />
<br />
Thanks!