This will be tricky, because summaries and running totals can only be evaluated after the records have already been printed. So if a SQL expression is out of the question, the easiest way I can think of would still be a little complicated:
- Add a new Group for
is_applicable
at the deepest level. (Right next to the Details section.) Suppress the header/footer and sort by descending order.
- In the Details section, create a Shared Boolean Variable that flips over to True every time it prints next to an
is_applicable
equal to 1. Reset the variable back to False every time the 2nd deepest Group changes.
- In the Details suppression section, write logic to suppress if the shared Boolean is True and
is_applicable
is equal to zero.
Done correctly, this should print any applicable entries first, and if none are found, the inapplicable entries won't display.