How do I set the number of rows to be displayed per page in a report using iReports. Ex: if i have 100 records, I wasnt to display 10 per page and then break. The default behavior is to cram all the records possible in the page.
Page height is not the right way to comtrol, if the text size changes, the count goes for a toss. Isn't there any other way to specify the count?
Vaishak Suresh
2010-06-17 08:59:51
Then you can do that using Variables. You can get increment a variable till your desired limit reaches. After that you have to start in an other page. I don't know if there is another way to do this.
Multiplexer
2010-06-17 09:03:40
Found a way, see my answer to the post.
Vaishak Suresh
2010-06-17 09:54:26
+2
A:
Ok! Found a way to accomplish this!
- The rows are usually printed in the
Details
band. - At the end of the details band, where you need a page break, add a pagebreak.
- In the pageBreak's properties, edit the printWhen Expression from the properties pane.
- The expression will be
new java.lang.Boolean((int)($V{REPORT_COUNT}.intValue())%10==0)
where 10 is the number of records per page.
This is how it is done in iReports. The jrxml equivalent for people directly editing the file is as below.
<break>
<reportElement x="0" y="23" width="100" height="1">
<printWhenExpression><![CDATA[new java.lang.Boolean((int)($V{REPORT_COUNT}.intValue())%10==0)]]></printWhenExpression>
</reportElement>
</break>
Put this just after the <band>
tag under <details>
tag.
Vaishak Suresh
2010-06-17 09:53:48