Home
Analytics
how to add a detail row to TableHandle
mohammadgh
Hi,
I am using BIRT DEAPI and i want to add a detail row to my table that alreadey exists
TableHandle table = (TableHandle) findElementHandle(design
.getBody(), 137);
RowOperationParameters params= new RowOperationParameters(0, -1, 1);
table.insertRow(params);
the problem is i can't unrestand what is RowOperationParameters parameters?
how i must create a RowOperationParameters that can be used to insert a detail row in a table handle?
any help will be greatly appreciated
Mohammad G.H
Find more posts tagged with
Comments
mwilliams
Hi Mohammad G.H,<br />
<br />
Have you seen the documentation on it:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/documentation/BIRT_231/EngineJavadoc/model/api/org/eclipse/birt/report/model/api/RowOperationParameters.html'>RowOperationParameters
(BIRT Model API 2.3.0)</a>
mohammadgh
Hi Michael,<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi Mohammad G.H,<br />
<br />
Have you seen the documentation on it:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/documentation/BIRT_231/EngineJavadoc/model/api/org/eclipse/birt/report/model/api/RowOperationParameters.html'>RowOperationParameters
(BIRT Model API 2.3.0)</a></p></blockquote>
<br />
yes,but i don't know what means the parameters!!!<br />
<br />
public RowOperationParameters(int slotId,<br />
int groupId,<br />
int destIndex).<br />
<br />
thanks .<br />
Regards
mwilliams
Mohammad G.H,<br />
<br />
Try something like this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
importPackage (Packages.org.eclipse.birt.report.model.api);
table = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Table1");
elementFactory = reportContext.getReportRunnable().designHandle.getElementFactory();
rowParm = new RowOperationParameters(2, -1, 1);
table.insertRow(rowParm);
myNewRow = table.getDetail().get(1);
tblCell = myNewRow.getCells().get(0);
label = elementFactory.newLabel("tblCell");
label.setText("dynamic cell");
tblCell.getContent().add(label);
</pre>
mohammadgh
thanks,
Mohammad
mwilliams
Mohammad,
No problem. Let us know whenever you have questions.
Sai krishna
<blockquote class="ipsBlockquote" data-author="mwilliams" data-cid="53674" data-time="1252507569">
<div>
<p>Mohammad G.H,<br><br>
Try something like this:<br>
</p>
<pre class="_prettyXprint _lang-auto _linenums:0">
importPackage (Packages.org.eclipse.birt.report.model.api);
table = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Table1");
elementFactory = reportContext.getReportRunnable().designHandle.getElementFactory();
rowParm = new RowOperationParameters(2, -1, 1);
table.insertRow(rowParm);
myNewRow = table.getDetail().get(1);
tblCell = myNewRow.getCells().get(0);
label = elementFactory.newLabel("tblCell");
label.setText("dynamic cell");
tblCell.getContent().add(label);
</pre>
</div>
</blockquote>
<p>Hello <span style="color:rgb(164,164,164);font-family:'Source Sans Pro', sans-serif;">Michael</span>,</p>
<p> </p>
<p>To which script i have to add this logic in the report. I am new to BIRT. Please help.</p>
<p> </p>
<p>Thanks in advance,</p>
<p>Sai</p>
Matthew L.
<p>You can add the script to the report layout's script method called: "beforeFactory"</p>
<p>Attached is a quick example using the script mentioned in your post.</p>
Sai krishna
<blockquote class="ipsBlockquote" data-author="Matthew L." data-cid="146280" data-time="1481643007">
<div>
<p>You can add the script to the report layout's script method called: "beforeFactory"</p>
<p>Attached is a quick example using the script mentioned in your post.</p>
</div>
</blockquote>
<p>Thanks for your response Matthew.
</p>