Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional suppression of group header based on Sum in group footer

Status
Not open for further replies.

flailcozy

Technical User
Dec 4, 2007
18
US
Howdy,

I have a report where I am trying to conditionally suppress a group header based on sums in the group footer.

The report is grouped by order#, and the order services are in the details section. If one or more order service has not been signed off as complete I want to suppress the group header for the order.

In the details section I have two formulas: one that tells if the order service is active (I don't want to count inactive services in the total) and one that tells if it has been signed off as complete. I have two sums in the order# group footer--one for each formula in the details section. So, it looks like this:

Group Header #1: {order_nbr}
Details: {@service_active}, {@service_complete}
Group Footer #1: {Sum of @service_active}, {Sum of @service_complete}

If {Sum of @service_active} > {Sum of @service_complete}, then I want to suppress Group Header #1. However, it looks as if the sums in Group Footer #1 are not being evaluated until Group Header #1 has been printed, so it's too late to use conditional suppression. I tried using WhileReadingRecords on the supression formula, but that didn't work. Is there any other way to force the sums to complete before the group header prints? Or maybe there's a different way to use counts to achieve this?

thanks, jc
 
You need to show us the content of your formulas and any formulas nested within them.

-LB
 
Sure, here they are:

{@service_active}:

IIF({ACCESSION_ACC_SERVICE.activate_rec} = True, 1, 0)

{@service_approved}:

IIF({ACCESSION_ACC_SERVICE.activate_rec} = True AND {ACCESSION_ACC_SERVICE.acc_srv_apprvd} = True, 1, 0)

 
I wouldn't use iif with CR unless you are sure that these fields cannot be null. Otherwise, you should be able to use a formula like the following in the section suppression area for the group header:

Sum (@service_active},{table.order_nbr}) > Sum( {@service_complete},{table.order_nbr})

-LB
 
Those fields can never be null, so the iif statement should be ok.

I was using something similar for the suppression that was not quite working, but your formula works perfectly--thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top