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 strongm 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 Problem 2

Status
Not open for further replies.

geoffreyg

Programmer
Dec 6, 2000
15
US
I am trying to suppress a Group Header and Footer based on the number of detail records in their section. If there is only one record I do not want either to show.

My thought was to create a Running Total (count) for the number of records. This works perfectly for the Footer. But since the Running Sum's value is 1 in the group header it does not work.

I tried creating a formula and placing it in the footer and linking that formula to the Suppress Condition. That did not work.

Any ideas?

===================================
Example #1 - Show Header/Footer:
Revenue Header
Income $500
Other Income $100
Total Revenue Footer $600

Example #2 - Do Not Show Header/Footer:
Income $600
===================================

Thanks!
 
Format your group header to suppress based on this forumla;
BooleanVar ShowGroupStuff ;
If OnLastRecord then
ShowGroupStuff := True
Else If Next({FieldYouAreGroupingOn}) = {FieldYouAreGroupingOn} then
ShowGroupStuff := False
Else
ShowGroupStuff := True ;

Format your group footer to suppress based on this forumla;
BooleanVar ShowGroupStuff ;

Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Wouldn't the following formula work as your suppress condition?

Count({FieldYouAreGroupingOn},{FieldYouAreGroupingOn}) = 1 Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Malcolm's solution would also allow you to display different text messages in the header, depending upon how many records appear in the group. If one record appeared, a certain message would display; if more than one record displayed, a different message would display. You could vary this even more by stipulating a range of conditions -- with appropriate text messages -- and then manipulating the Boolean variable accordingly to display the one you wanted in each case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top