Jump to content
We've recently updated our Privacy Statement, available here ×

Pagination in iReport


MohanRao

Recommended Posts

Hello,

 

Is there any option of setting the 'results per page' option in iReport? If yes, please let me know. I could find the resPerPage in Pagination class. But could not get where to set the number of results per page. Please help me.

 

Thanks,

Mohan.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

There is no such setting in iReport.

 

 

You could potentially manipulate the resPerPage via a scriptlet.

 

 

But you could also achieve this using groups as there is a "Start on a new page" parameter in the group settings.

 

 

In your source query you would configure a new group field based on rownumber. An Oracle example that limits the number of records per page to (say) 35 would be something like this:

 

 

select trunc(rownum/35) as myGroup, first_name, last_name from turbine_user

 

 

MySQL is a little different in that it doesn't have any concept of rownum. It needs something more like this:

 

 

SELECT floor((@rownum:=@rownum+1)/35) as myGroup, t.*

FROM (SELECT @rownum:=0) r

, (SELECT AccountName from DigiToll.Account) t

Link to comment
Share on other sites

  • 1 year later...

jmurray wrote:

There is no such setting in iReport.


You could potentially manipulate the resPerPage via a scriptlet.


But you could also achieve this using groups as there is a "Start on a new page" parameter in the group settings.


In your source query you would configure a new group field based on rownumber. An Oracle example that limits the number of records per page to (say) 35 would be something like this:


select trunc(rownum/35) as myGroup, first_name, last_name from turbine_user


MySQL is a little different in that it doesn't have any concept of rownum. It needs something more like this:


SELECT floor((@rownum:=@rownum+1)/35) as myGroup, t.*
FROM (SELECT @rownum:=0) r
, (SELECT AccountName from DigiToll.Account) t
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...