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

Suppressing a qroup header if equal to another group header

Status
Not open for further replies.

Meredith

Technical User
Mar 8, 2002
17
US
I was wondering (if possible) the best way to go about suppressing a group header if it is equal to another group header. To clarify, say I have 5 fields in 2 group headers and I don't want the second group header to print if the 5 fields hold the same exact data as the first header.

I'm currently using version 8.5

Thanks...
 
Sorry if I appear a bit confused - but when would this ever happen?

A group, by definition would have to be unique from another group, otherwise the data would be included as one big group. So there'd have to be something differentiating the two groups from each other.

Are you expecting a break in the group where you are getting one? Because, from what you describe, it sounds for all the world like you have the 'Repeat Group Header on Each New Page' switched on, and are getting this repetition on each new page.

Set me straight if I'm way off, because I confess to being a bit mystified by your symptoms.

Naith
 
Naith: I think that the 2 groups are on single fields, and they want to suppress if a combination of 5 fields are identical in the header.

Try a suppression criteria on the group which compares the:
previous{field1} = {field1}
and
previous{field2} = {field2}
and
...

Another approach might be to group on all 5 fields, and display on the innermost, if that's a possibility.

-k kai@informeddatadecisions.com
 
I know this seems like an extremely odd request but I have an odd situation. What I'm basically doing is grouping by one field and then in the group header throwing in other fields to display along with it. In total I have about 6 fields that are put into the group header and from there I created 6 separate groups that will be compared to the first grouping. It almost appears to be like a page header but in this situation page headers aren't of use to me.

Example (not a very good one, sorry):

Group 1
---------------
Pens (this field is being grouped on)
Glue
Paper

(Group 1 is what every other header will be compared to)

Group 2
---------------
Pens
Glue (this field is being grouped on)
Paper

(Group 2 will be supressed)

Group 3
---------------
Pencils
Glue
Paper(this field is being grouped on)

(Group 3 will not be supressed)


I know it's a bit silly and I thank you for even taking the time to look at it. If you're still interested and need further clarification, let me know.

 
Meredith: is it that you have 3 groups and want to have the report look at the data several different ways?

if that is the case....and I am not sure it is :)... then you could create a parameter to control the grouping

eg.

{?ReportGroup}
parameter type: string
description: Type "1" for Pens/Glue/Paper
"2" for Glue/Pens/Paper
"3" for Paper/Pens/Glue
"4" for Pens/Paper/Glue
"5" for Glue/Paper/Pens
"6" for Paper/Glue/Pens
default: 1

then create a grouping formula for each group

@grouping1

if {?ReportGroup} = "1" or {?ReportGroup} = "4" then
{Table.Pens}
else if {?ReportGroup} = "2" or {?ReportGroup} = "5" then
{Table.Glue}
else if {?ReportGroup} = "3" or {?ReportGroup} = "6" then
{Table.Paper}
else
{Table.Pens} ;// a default in case of a bad entry

A similar formula would be made for Groups 2 and 3

Not sure if this is what you want...but sorta sounds like it. Jim Broadbent
 
I think that my intial suggestion can get you there:

But you should really group on the five fields and display at the innermost level if you want to see the different combinations of the 5 fields (or suppress acordingly in the Detail, which isn't pretty), it may also allow for passing the grouping of the data on to the server and greatly improve performance.

or if you require the row level mode:

"Try a suppression criteria on the group which compares the:
previous{field1} = {field1}
and
previous{field2} = {field2}
and
..."

Substitute the 5 fields in your report for those containing pens, glue, paper, etc...

Keep in mind that you're grouping on just two fields, so you WON'T see all combinations of the 5 fields, just the combination that comes first in the GH, or if you've turned on the repeat group header on each page, you'll see whatever was there when the next page started...

I doubt that's what you realy want

-k kai@informeddatadecisions.com
 
er, wait a minute, the row level theory won't work if you expect all combinations of the 5 rows, but it will nuke dupes...

If you want all combinations but no repeats, group on all 5.

The request is unusual because you can't get a distinct grouping of 5 fields using only 2 unless you concatenate 5 fields into 2.

Which is an equally bizarre solution...

Sorry, very tired today, but 'm sure you get the idea.

-k kai@informeddatadecisions.com
 
Meredith.

In your example it isn't clear to me if this is all one field with 3 values, or if these are different fields in a group heirarchy. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top