vans Posted April 9, 2009 Share Posted April 9, 2009 Hi All, Please help to find out a solution...How to restrict number of lines per page in iReport?Is there any option in iReport? thanksVans Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted April 9, 2009 Share Posted April 9, 2009 Create a group, force the group to be printed on a new page (there is an option for the group).Use as group expression something like:new Integer( (int) ( $V{REPORT_COUNT}.intValue() / 10 ) )10 in this case is the number of records per group (aka per page)Giulio Link to comment Share on other sites More sharing options...
vans Posted April 9, 2009 Author Share Posted April 9, 2009 Hi Giulio, thanks for your reply.My issue is , number of records coming to REPORT_COUNT is not fixed , it is flexible.and i want to show 5 lines per page in report.. if there are are 7 lines of data, 5 in first page ad remaining 2 in next page. can you please give me a solution for this thanksvansPost Edited by neha prasanth at 04/09/09 05:52 Link to comment Share on other sites More sharing options...
mdahlman Posted April 9, 2009 Share Posted April 9, 2009 Vans, Giulio's answer does exactly what you are looking for. REPORT_COUNT certainly isn't a fixed value. Well, his example is for 10 rows per page. But changing "10" to "5" isn't difficult. ;-)Have you tried it yet? Please let us know if you're successful. Regards,Matt Link to comment Share on other sites More sharing options...
vans Posted April 13, 2009 Author Share Posted April 13, 2009 Hi Matt, I tried but its not working. For testing purpose i created a new group called "PageCount" and force the group to be printed on a new page and expression i put new Integer((int)($V{REPORT_COUNT}.intValue()/2)) for testing purpose i restrict no.of records per page as 2. dataset is retrieving 3 records from data base. but i am getting only 1 page report with only 1 record in a page. Please help me to resolve the issue.i here by attaching report.jrxml file for your referencethanks vansPost Edited by neha prasanth at 04/13/09 01:22Post Edited by neha prasanth at 04/13/09 07:47 Link to comment Share on other sites More sharing options...
mdahlman Posted April 13, 2009 Share Posted April 13, 2009 vans, Your idea of creating a minimal report to show the idea is perfect. It appears that your jrxml did not get attached. Please try fighting with the forum again to get it posted, so we can take a look. ;-) Regards,Matt Link to comment Share on other sites More sharing options...
vans Posted April 15, 2009 Author Share Posted April 15, 2009 Hi Matt, Here is the jrxml file. Please have a look. thanksvans Link to comment Share on other sites More sharing options...
vans Posted April 16, 2009 Author Share Posted April 16, 2009 Hi Matt, I am eagerly waiting for your solution.Please help methankspreethi Link to comment Share on other sites More sharing options...
vans Posted April 21, 2009 Author Share Posted April 21, 2009 Hi All, Can anyone, help me to find a solution for this issue? thankspreethi Link to comment Share on other sites More sharing options...
jaspermadhu Posted June 19, 2013 Share Posted June 19, 2013 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. new java.lang.Boolean((int)($V{REPORT_COUNT}.intValue())%10==0) Link to comment Share on other sites More sharing options...
jaspermadhu Posted June 19, 2013 Share Posted June 19, 2013 Ok! Found a way to accomplish this!The rows are usually printed in the Detailsband.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 benew 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>[/code] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now