Jump to content
JasperReports Library 7.0 is now available ×

How to do group break exactly once per page


Recommended Posts

By: Juel - juel73

How to do group break exactly once per page

2006-03-15 12:37

 

Hi,

 

Sorry for the possibly beginner question, but I was unable to produce the effect mentioned in the subject, namely to have my group displayed on each page of the report.

 

I tried the obvious, putting $V{PAGE_NUMBER} in the group expression, but for reasons unknown to me it did not work.

 

Scanning through this forum I found the isReprintHeaderOnEachPage property of the group mentioned, but while it can solve part of the problem, what about group footers ? Anyway it is just sidestepping the task. Anyone any ideas how to get this happen ?

 

Possibly I am missing something very simple, please help :( Thanks in advance

 

 

By: Denny Valliant - xenden

RE: How to do group break exactly once per pa

2006-03-15 14:30

You could try changing the evaluation time, that might effect your results, but if I recall there's something about page_number that makes it so you may be better off using a different variable, one you create yourself, to track the current iteration or whatever.

 

That's a really complicated way of getting what you want tho. I'd suggest maybe using a GUI like iReports and just playing around with the groups and the available options for groups and report elements and such, you'll see there is an easy way to get groups to print on each page if you want. Can't remember off hand how to do it tho, sorry.

 

Have Fun!

XD

 

 

By: Juel - juel73

RE: How to do group break exactly once per page

2006-03-17 02:56

 

Thanks for the answer, XD !

 

You have me confused with the evaluation time. Can you set it on group expression ? According to the docs I checked, not.

 

I am using iReport, however it is an early version (0.5.1) due to version restrictions, and is missing access for several group options I have to set directly in XML.

 

As you said, I also read some hints about PAGE_NUMBER, suggestions to avoid its usage. Problem is, AFAIK the pagination is calculated by Jasper, and this is the variable tracking it, so how can one avoid it (unless working with fixed number of rows per page, which is not always desirable) ?

 

Well, I'll continue experimenting.

 

 

By: Denny Valliant - xenden

RE: How to do group break exactly once per pa

2006-03-17 14:18

NP Juel! Thanks for thanking. =] I try to assist but feel like my discombobulatedness may hinder at times more than help. =]

 

You're right, I don't think you can set the group's evaluation time. You can create a variable within the detail, set it's evaluation time to "now", and use it in the group's expression, but that may have the same drawbacks as using the built in page number variable.

 

Have you played with the "start on new page" (probably isStartNewPage or similar in jrxml) option for the group? That does both header and footer.

 

Other than that, you could play with heights and minStartNewPage and such... sorry no solution.

 

If you can update your version of iReports I'd go for it, I'm really impressed with the quality of that application (although I can't speak highly enough for just going through the jrXML and getting a grasp of it, bravo!).

I can't speak highly enough about JasperReports itself, what an awesome application, with awesome developers. Really outstanding.

 

Well, I gotta go, but good luck!

XD

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...