Jump to content
Changes to the Jaspersoft community edition download ×

How to keep several band footers together


2006 IR Open Dicussion

Recommended Posts

By: Neil Lamka - neil_lamka

How to keep several band footers together

2006-04-18 17:18

I have a report that (for various reasons) has the interesting detail of the report in 3 band footers. Each of these bands may expand in height to fit the text but none of them are very large (a default height for each of 12).

 

What I'm trying to do is figure out how to setup the report so that this group of 3 band footers are never split across a page boundary.

 

I'm using a scriptlet to do some complex calculations so if there is some calculation I can use there I can add code to make this happen.

 

Any suggestions would be appreciated.

 

Thanks

Neil

 

 

 

 

By: C-Box - c-box

RE: How to keep several band footers together

2006-04-20 15:05

I could only imagine something like this in your beforeGroup1Footer method where you must look for the current y pos and if there are 36 (3x12) pixel left, then okay, if not, break the page....

 

but what if the text of all 3 bands is lager than one page!??! this would cause an infinity loop!?!?! So quite a tricky thing.

 

I would more play around with the "MinHeightToStartNewPage" attribute... first group 36... second group 24... third group 12.... perhaps this works (as it is a standard jasperfeature)

 

just my two cents

post your solution (if you find one) please...

 

think that this could be interesting for more people. (e.g. me! :-))

 

C-Box

 

 

 

 

By: Neil Lamka - neil_lamka

RE: How to keep several band footers together

2006-04-21 10:50

Thanks for the reply.

 

In my specific case I'll never have a case where I get into the next 3 bands is larger than one page..but I understand the general problem you pose.

 

Since (again in my case) by the time I get to the point where the first band footer of the 3 is to be rendered I have all the information as to what is going to go into each band in my Scriptlet. So if there was a way to use that information to figure out what the actual ... final rendering height of each band will be I could use that along with somehoe finding out how much space is left on the page to decide to break the page or not.

 

Of course, using the existing MinHeightToStartNewPage attribute would be preferable and I can "guess" heights that will work most of the time...but not always and when not I can't afford to have the report break as it does not.

 

Neil

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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