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

Status
Not open for further replies.

dleewms

Programmer
Aug 19, 2001
118
US
Report version 11
Database SQL Server within a MAS500 Enterprise application.

I need to suppress the group header based on the records in the detail section. Records in Details are conditionally suppressed when the level field does not equal 1 {tmfBOMWhereUsWrk.BoMtLevel}<>1. If no records are returned in Details, I need to suppress the group header.

Using the same expression, {tmfBOMWhereUsWrk.BoMtLevel}<>1, to conditionally suppress the group header doesn't work because it only considers the first record. I have also created a running total to count the records in the group where the level = 1, but this count is not accurate until we get to the group footer and therefore of no use to me in suppressing the group header. I can't use a standard summary expression, because I'm not able to add the condion to only summarize where level = 1. In the example below, I would like to have the group header information of 3008680-01 suppressed because there are no items with a level 1, hence no detail records are returned.

Any help would be appreciated.

Sample Data

Group by Component
Item Version Level
3008680
302255 A 1
400007 B 1
3013354 A 1

3008680-01

3008680-02
10000725 C 1
3019007 A 1




Thanks,
DLee
 
Try like this:

One formula "test1" placed in group header:
Global booleanVar x = false;

Another one "test" placed in Details section:
Global booleanVar x;
if {tmfBOMWhereUsWrk.BoMtLevel} <> 1 then
x := true
else
x := x

Another formula "test2" placed in group footer that just displays the result of the formula from Details section.
{@test}

Then from Section Expert conditionally suppress the Group Header based on the result returned by this last formula.
{@test2} = true;





"Now I can look at you in peace; I don't eat you any more." Franz Kafka, while admiring fish in an aquarium
 
What other values can the level field have? If it can only be one or zero, then you could use:

maximum({tmfBOMWhereUsWrk.BoMtLevel},{table.groupfield}) = 0

If there are only values of 1 or greater, you could use:

minimum({tmfBOMWhereUsWrk.BoMtLevel},{table.groupfield}) > 1

-LB
 
The level field can have any value, beginning with 0.

Thanks!
 
Okay, then create a formula like this {@level1}:

if {tmfBOMWhereUsWrk.BoMtLevel} = 1 then 1

Then use a suppression formula like this:

sum({@level1},{table.groupfield}) = 0

-LB
 
That worked LB. Thank you very much!

Patricia, I tried yours as well, unfortunately, it didn't work for me. Still, thanks for trying to help me!

DLee
 
Sorry, it worked with my sample data.



"Now I can look at you in peace; I don't eat you any more." Franz Kafka, while admiring fish in an aquarium
 
Patricia,

Your idea works. I changed it to 'count' the number of records being displayed, and then if the value is 0 in the footer it will supress the header.

However, I had to add WhilePrintingRecords; in each formula.

Thanks for your insight on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top