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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress Group Footer in Subreport if Summary equal 0

Status
Not open for further replies.

NBVC

Technical User
Sep 18, 2006
80
0
0
CA
I have a subreport with Summaries in Group Footer.

I am trying to suppress the group footer section if summary result is 0.

I went to the Group Footer section expert, click the formula tool and inserted Basic formula:

if Sum ({@ExportPrice})=0.00 then
formula = true​
else
formula = false​
end if

It is not working though. All summaries are showing even the 0 values. I even tried rounding the Sum ({@ExportPrice}) to make sure of the 0 result.

What am I doing wrong?
 
A couple of thoughts.

One, are you certain you have the formula in the correct place? Ensure that you have the group header section selected in the Section Expert and that you have the formula behind the X+2 button to the right of "Suppress (No Drill Down)".

Second, are you sure that the sum of the formula is 0? Is is possible that there is a decimal? Test it by displaying the sum in the group header or footer and expanding out the number of decimals that are showing.

I tested your formula in a test report I built and it is working so I suspect one of the two above scenarios might be the issue.


~Brian
 
Hi Brian,

Thanks for the reply.

My information that I want to suppress is in the Group Footer, not the Group Header. Isn't it in the Group Footer that I would apply the conditional formula? And yes, I selected the X+2 button for "Suppress (No Drill Down)". I also thought about the 0 maybe having decimals, although it would be impossible since the data we enter are whole numbers... but I did try rounding the formula in the conditional format to no avail.

i.e.

if ROUND(Sum ({@ExportPrice}),0) = 0 then
formula = true​
else
formula = false​
end if

But, what I did find that worked for me is that I went to Report>Select Expert > Group Expert and applied formula:

Sum ({ARInvoiceLines.arlInvoiceQuantity}, {PartRevisions.uimrCountryOfOrigin}) > 0.00​

and it seems to have done the job.

Not sure if this is the right way or not though, and if I will come across a problem with that method in the future....
 
Inthe Section Expert, select Group Footer and click on the X+2 button to the right of "Suppress (No Drill Down)". Enter
[tt]Sum ({@ExportPrice})=0[/tt] and see if it works.
 
i tried that first. Then I went to the "Basic Syntax" and tried the above.... didn't work.
 
I should have stated Group Footer rather than the Header.

I just realized what the issue is. The Sum function you are using is the overall or grand total of the field. You need to reference the subtotal:

if Sum ({@ExportPrice}, {PartRevisions.uimrCountryOfOrigin})=0.00 then
formula = true
else
formula = false
end if

Of course, you would have to remove the criteria in the Group Selection Formula to ensure this works. The difference between the two solutions is that the Group Selection Formula will remove those other groups from your report completely where the suppression just hides them. Depending on what you need the report to do, one solution will be better than the other in each case.

~Brian
 
Great.

Thanks a lot Brian. That helps.

@Betty, thanks for you assistance also. It is a formula that I am summarizing... @ExportPrice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top