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 header 1

Status
Not open for further replies.

MarcusHemy

Programmer
Nov 23, 2001
14
0
0
GB
I want to suppress the group header where the group itself is suppressed. I have tried all the suggestions in other similar threads but none of them work.

It is an intercompany report which lists how much company A owes company B, C, D etc and how much company B, C, D etc owes company A. If it comes out to zero you don't want to see it.

Group Header 1 - Company
Group Header 2 - Counterparty (always suppressed)
Details (always suppressed). Accumulate details.
Group Footer 2 - Print out accumulated details where the value is not zero.
Group Footer 1 - Print out totals for the Company.

The problem is that if there are no records to be printed for a Company I can suppress Group Footers 1 and 2 but not the Group Header 1.

Any ideas greatly appreciated.

Thanks
Marcus
 
How are you suppressing group footer 1? The same formula should work. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
The formula to suppress Group Footer 1 does not suppress the Group Header because the whole group has to be evaluated before the suppression can work. The report counts the number of records printed by using the formula in the details section:

if {@Variance} <> 0 then
1
else
0

If the number of records printed is 0, it suppresses the footer:

if {@SumRecordCount} = 0 then
true
 
the trick here is to ALWAYS SUPPRESS Group 1 header... IE. The company name.

Crystal is linear...it cannot back up after it has printed something and suppress once it has printed.

SO ... hopefully the information in the Group 1 header is just description...so print it out in the Group 2 footer.

the Group 2 footer section will be suppressed if the values are zero....the only tricky part is preventing a repetition of the information in subsequent footer lines for the same company information.

to do this you have to set a flag such that if you print one Group 2 footer section ...you will suppress the company information fields (in the field's conditional suppress)in all subsequent Group 2 footer sections for the same company.

I usually do this in the formula that determines the &quot;Non-zero&quot; value....

Does this make sense...the formula is tricky but once you get it, it works well.

JimBroadbent@Hotmail.com
 
Ngolem - thanks. I haven't done quite what you suggested but you've certainly put me on the right track. I didn't want to put the Company header text in Footer 1 because I thought that even if I could suppress all but the first I would have difficulty formatting the report so that the blank space didn't show.

I have put the Company header in the details section and I then have a suppress section formula which says:
if the value is not zero then
if the flag 'ShownHeader' is false then
set 'ShownHeader' to true
don't suppress (ie false)
else
suppress (ie true)
else
suppress (ie true)

'ShownHeader' is then reset to false in Group Header 1.

So, that's that problem solved now onto the next one...
 
Glad it worked out...I'll have to remember your approach. Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top