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

Suppress Group

Status
Not open for further replies.

harding1031

Programmer
Oct 21, 2004
65
US
CR v 9.0
I have a group report in which sometimes there are no details within a group. I tried to use the Selection Formula for a Group, but because I have to use a suppression formula for my detail line
(Count ({IMITREP.KT43A}, {IMITREP.SCEOA}) > 1) does not work in the Group Selection Formula. How can I manually suppress a group when using a suppression formula in my detail section. I don't know if the group is empty until I am printing the report.
 
Try posting example data and expected output/

You make reference to a suppression formula for the details section, you should post it.

Eliminate the details suppression formula, use the group selection formula, and then post what suppression needs to be done in the details.

-k
 
but because I have to use a suppression formula for my detail line

Why are you supressing instead of excluding the records from your report entirely? Maybe you need to get rid of the suppression formula in your detail line and use a record selection formula instead.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
"I have a group report in which sometimes there are no details within a group." Then the group would not be appearing. Do you mean no suitable details? That would explain why the count failed - you are counting details that are part of the group but not wanted for your report.

As dgillz said, you should be trying to get rid of unwanted records in your record selection.

Failing this, a running total using some sort of test for its count can be used to suppress a Group Footer when none of the detail records are suitable for the report.



[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Ok, I could not use the record selection to eliminate records that are not going to be displayed is because the I have to retrieve 4 record types(01,02,03,04). I only want to display record types 02 and 03. For record types 01 and 04, there can be multipe 02 and 03 type records and I only want the 1st 02 record type and the last 03 record type for every 01 and 04 type record - example:
01 first record of process - suppressed
02 - need this one
02 - suppressed
03 - suppressed
03 - need this one
04 last record of process - suppressed
01 - suppressed
02 - need this one
03 - suppressed
03 - need this one
04 last record of process - suppressed
...
Now sometimes there may be no 02 and 03 type records, but will be 01 and 04- so how do I suppress this group since there are no 02 and 03 records.
Hope this helps my explanation.
 
A bit clearer.

You have options available, one brute force method is to use variables in 3 formulas (again, you would have been better served to post example data and expected output):

Group Header section:
whileprintingrecords;
booleanvar two:="";
booleanvar three:="";

Details section:
whileprintingrecords;
booleanvar two;
booleanvar three;
If {table.type} = "02" and two = "" then
two := {table.field}
else
If {table.type} = "03" and next({table.type}) = "04"
three := {table.field};

This assumes that you're grouped and that the {table.type} is sorted.

Now you use the group footer section to display the variables two and three (or build as many as you need for whatever data types) if they are not "", which is the same as suppression.

You could also use a form of this theory to just do suppression of the details.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top