[#10851] - Link print when logic for group header & footers

Category:
Feature request
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

Hi,

I would like the ability to link the group header & footer's print when logic so both the header and footer can be suppressed when using the same piece of logic when that logic involves a group total e.g. $V{group_total}!=0.00 which I currently cannot use to hide the group header due to it's evaluation time.

Hopefully that makes sense as to what I would like to happen.

Thanks

Jeremy

group report
jeremy.suiter's picture
Joined: Mar 11 2015 - 2:24am
Last seen: 1 week 5 days ago

2 Comments:

#1
  • Status:New» Feedback Requested
  • Assigned:» teodord

Hi,

Unfortunately, this cannot be achieved in a straightforward way.

The only way I can think of is to use sort fields in the dataset and thus benefit from the fact that the JR engine would go through your data records once, to sort them, and then go through them a second time to produce the content.

You could use a scriptlet implementation that would store the group totals calculated on the first pass in a map, so that during the second pass you have those group totals readily available in the printWhenExpression of the group header.
Your scriptlet implementation would be called during both iterations through the data, but you could differentiate between the two by checking the type of the REPORT_DATA_SOURCE built-in parameter. On the second pass, it is an instance of SortedDataSource.

I hope this helps.
Teodor

#2

Teodor

This sounds really promising is there any documentation or examples on how to use scriptlets and the built in parameter to help me get started trying this out?

Thanks

Jeremy

Feedback
randomness