How to control the number of rows in a JasperReports

前端 未结 2 1716
失恋的感觉
失恋的感觉 2020-12-03 06:04

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 be

2条回答
  •  情歌与酒
    2020-12-03 07:05

    Ok! Found a way to accomplish this!

    1. The rows are usually printed in the Details band.
    2. At the end of the details band, where you need a page break, add a pagebreak.
    3. In the pageBreak's properties, edit the printWhen Expression from the properties pane.
    4. 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.

    
        
            
        
    
    

    Put this just after the tag under

    tag.

提交回复
热议问题