Jump to content
Changes to the Jaspersoft community edition download ×

Hide certain fields until end of group

2004 IR Help

Recommended Posts

By: optimalsoft - optimalsoft

Hide certain fields until end of group

2005-05-03 05:30



I need to generate bulk invoices on specific paper that includes a kind of cheque. I am using a single data file for all the invoices, grouping by order nr.

This works very well, except that when an invoice is too long, the cheque information is printed on each page. I need that to be printed only on the last page of the group.


Is there a simple way to hide the text fields in the pageFooter until the end of group is reached?


Just to avoid any misunderstanding, using lastPageFooter won't work, because it will create a single footer for all my invoices.


Thanks a lot for any help.







By: Teodor Danciu - teodord

RE: Hide certain fields until end of group

2005-05-04 00:50




There is a way, but I would not call it simple.


You have to devise a way so that you could know

that the end of the group occured on the current page.

I would use a scriptlet for that.


Make a scriptlet class and associate it with your report

template like shown in the "scriptlet" sample provided.

Then use a Boolean flag inside your scriptlet class

let's call it isEndOfCheque. On "afterGroupInit" you always set this flag on Boolean.FALSE.

You set it on Boolean.TRUE in a method call "setEndOfCheque" which itself returns always Boolean.TRUE.


Use this inside the printWhenExpression of your page

footer elements:




and this one iside the printWhenExpression of your

group footer:




Note that this will work properly only if each cheaue (group)

starts on a new page.


I hope this helps.







By: optimalsoft - optimalsoft

RE: Hide certain fields until end of group

2005-05-04 14:37

Thanks a lot, Teodor, and congratulations for an excellent piece of software!



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