0
votes

I have report with a group 1 and group 2. For formatting purposes group 2 header and details are suppress and all information is presented in the group 2 footer. I have set up the report to suppress the group 2 footer if a certain condition is met, The means that sometimes the entire section under the group 1 header is blank and I want to suppress it.

Here is how it is set up

Group 1 - Employee Group 2 - Client (suppressed) Details (suppressed) Client name field1 field 2 field 3 field 4

For fields 1-4 the are possible returns of "Draft", "Final" and null. I'm only looking for "Draft" and null values.

So how I've set up the group 2 footer is to just return the client name and a formula summing up the values of all four fields {@draft}

if {#divDraft} + {#convoDraft} + {#yearDraft} + {#rovDraft} >= 1 then "Draft" else if {#divFinal} + {#convoFinal} + {#yearFinal} + {#rovFinal} >= 1 then "Final" else " "

I then suppress the footer based upon {@draft} returning "final"

Is possible to suppress the group 1 header if every client in that group has either all four fields returned as null or at least one returned as draft?

I tried running a subreport and then placing that and a shared variable in the group 1 header but that didn't work right

WhilePrintingRecords; Shared NumberVar totalSuppress; Global NumberVar suppression; suppression := Shared NumberVar totalSuppress;

The {@totalSuppress} formula in the shared report added the times at least one "draft" was returned with the number of times all four fields were null. I placed that in the footer of the subreport and then {@suppression} in the main report group header.

What I got was a pattern where the first group header was returned 0.00 where it had 4 results and 4.00 in the group footer. Then the next group had 4.00 in the group header where it had 1 result and 1.00 in the group footer. And the next one had 1.00 in the group header and so on.

I tried to do a formula to reset the variable with each group header. So I wrote

Global NumberVar suppression; suppression := 0

But all that did was return 0.00's in the group header.

Any other ideas would be welcome.

RE: Tried new formula

if {sales_div.draft_pend_approv_Value} = "Draft" or {sales_div.draft_pend_approv_Value}  = "Pending Approval"
or {convoSales_200.pending_approval_Value} = "Draft" or  {rov_client.pend_draft_Value} = "Draft"
or {yearly_sales.draft_pend_Value} = "Draft") then 1
else if isnull({sales_div.draft_pend_approv_Value}) and
isnull({convoSales_200.pending_approval_Value}) and   isnull({rov_client.pend_draft_Value})
and isnull({yearly_sales.draft_pend_Value}) 
then 1
else 0
1

1 Answers

1
votes

If I understand correctly, you're trying to use the result of a Running Total Field to suppress a header - which won't work as the running total is only calculated in the footer.

You can try a different approach. Make a Formula Field which will go into your Details section. It should simply check if that row is the kind that you want to show, something like:

if (isnull({field1}) or isnull({field2}) or ... or {field1} = 'Draft' or {field2} = 'Draft' ...)
then 1 else 0

Then in the Group Header #1, in Section Expert, inside the Suppress formula put

sum({@check},{Employee})=0

where {@check} is that formula field and {Employee} is the field on which Group 1 is created