Home
Analytics
Birt Report Design
myusuf
<p>Hi, I am new to this Birt Design and I designed a report. In that report I have two tables. In the first table I have a column which is a number from dataset(any no returned by dataset e.g. 5). So now depending on this number I need to repeat the second table that many times. How do I do it in the Birt Report...???</p>
<p>Please Help me in getting this done. (Note : the dataset for second table may be diff.)</p>
Find more posts tagged with
Comments
mwilliams
<p>One thing you could do would be to create a scripted data set using the value returned from your first data set. The scripted data set would number 1 to N, with N being the number returned by your data set. You'd then put a table in your layout that is bound to your new scripted data set that will have N detail rows. In the detail row, you'd embed a table from the data set that you want to repeat N times. That would do it. Let me know your BIRT version and I'll make you an example.</p>
Matthew L.
<p>To clone a table multiple times you have to add the tables in the beforeFactory method in order for them to apply to the report output.</p>
<p>However you are wanting to clone tables based on a value returned from a dataset which complicates the issue, because beforeFactory occurs before the dataset queries run.</p>
<p>So to get around this issue, you have to query the dataset for its result value (number of table copies to make) using API code in the beforeFactory.</p>
<p>Then with the result value (number of table copies to make) we need to find the second table (by name) and apply copies to the report design.</p>
<p> </p>
<p>Attached is an example of this process.</p>
<p> </p>
mwilliams
<p>Here's an example of the way I described. Either way will work. In this one the only code you write is to grab the number of copies value in a persistent global variable (must hide text box at the top of the report if not using it elsewhere to run the data set), use this value to create a 1-N scripted data set, add a table bound to this new dataset to your layout, and finally, put the table you want multiple copies of in the detail row. Hope one of these helps you.</p>
myusuf
<p>Thanks all for your Ideas. I got the issue solved with help of subreport concept. Thanks again.</p>
mwilliams
<p>Glad we were able to help. Let us know whenever you have questions.
</p>