×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Suppress Group Header

Suppress Group Header

Suppress Group Header

(OP)
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

RE: Suppress Group Header

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

RE: Suppress Group Header

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

RE: Suppress Group Header

(OP)
The level field can have any value, beginning with 0.

Thanks!

RE: Suppress Group Header

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

RE: Suppress Group Header

(OP)
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

RE: Suppress Group Header

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

RE: Suppress Group Header

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close