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

Suppress group header if detail section is blank

Status
Not open for further replies.

mmarino

Programmer
Mar 22, 2002
42
US
Hi there, I'm using CR 11. I have titles (labels) in my header, and summaries in the footer. If there is no data returned for the detail section I would like to suppress both the header and the footer, and instead print something like "no data on file". Is that possible?

Thanks,

mm
 
Hi,

I'm using CR10 now, but should be same for CR11.

In the report options, make sure un-check suppress printing if no records, otherwise, you will get a blank page.

Then write a formula in the suppress option of section expert in where you want to suppress, like:

If Isnull(one of your field) or field = "" (0 if it's number field) then
true
else
false;

after that, put your message into the section you want to display.

Ted

 
Thanks Ted, I tried that, but nothing happens!
 
Hi,

What exactly is nothing happens, coming out as blank page or you did get something but what you need?

There is one more place you may need to check, in Options under file menu, under reporting tab, you need to uncheck a check box with same suppress conditions as in report options.

Hope it helps,

Ted
 
Ok, I'll be more specific. This is my formula field:
if Count ({tbAgingSubmital.SourceNumber}, {tbCustomer.CustomerNumber})=0
then true else false[/color red]
It's called EmptyDetails. I then add if ({@EmptyDetails}) then true else false[/color red]
to my Suppress Blank Section in the section expert. But even when the count is 0 (therefore there are no details) I still get my header to show on the report.
What am I doing wrong?
Thanks,

mm
 
Hi,

I used the formula all the time and it always works.

You may need to add IsNull condition in your EmptyDetail formula, or you may not need to use EmptyDetail formula to suppress the section, you can directly write a formula into the suppression option with checking the detail value, like:

If isnull(tbAgingSubmital.SourceNumber) or tbAgingSubmital.SourceNumber = 0 then true else false;

Ted



 
Actually there must be something I'm not setting, because I even tried if 0=0 then true [/color red], and it still doesn't get suppressed.
Thanks for the help though :)

mm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top