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

Suppress group headings

Status
Not open for further replies.

uachap

Programmer
Mar 9, 2004
11
0
0
US
I am running Crystal v.8.

I have two groups in my report. Region (1) and Department (2). My detail line will only print if the total hours for an employee in that department is over a parameter driven number.

I have under detail format section > suppress > x-2 the following:

{@TOTAL} < {?hours}

@total is a formula that is simply a sum of different types of hours on the report (regular, vacation, sick, etc.)

Since I suppress the detail for anything under the hours passed in through a parameter, there are could be departments that have no data. For instance, if I run the report and say show employees that have worked more than 20 hours in a day, the report will pretty much be empty. However, my problem is, the group headings for both groups still print.

How can I suppress the group headings if no detail line under that group is being printed?

Thank you!
 
Try creating another formula which sums the number of hours for that group and reference it in the suppression of the group.

-k
 
The problem that I see with that is the sum of the total for that group will always have a value. For instance:

If I turned off my suppression formula in my detail section I could have:

Row 1 - 5 hours
Row 2 - 2 hours
Row 3 - 4 hours
Row 4 - 1 hour

With the suppression on for hours less than, say, 6, none of the detail fields would display. If I sum them and say only print the group 2 heading if there is a positive number, I still end up with a group heading with no detail. Am I misunderstanding what you're saying?

Thanks
 
try to put the selection formula, not in the suppress X-2 of the detail, but in the record selection formula.
Furtermore, you'll have less problems with summarizing field values.

--------------------------------------------------
[highlight]Django[/highlight] [thumbsup]
bug exterminator
tips'n tricks addict
 
Iam using crystal reports 8.5 version. I created report with 11x17 paper size. Which is runnig fine in my local machine. When i call this report from my webserver report display format is gone.Paper size is legal iam missing my data.

How can i display this report with the same papersize
(11x17) through webserver
 
Create a formula {@grtrthanparm}:

if {@Total} < {?hours} then 0 else 1

Then go to format->section->Group header #1->suppress->x+2 and enter:

Sum({@grtrthanparm},{table.region}) = 0

Then highlight Group Header #2->suppress->x+2 and enter:

Sum({@grtrthanparm},{table.department}) = 0

-LB
 
I actually had to add a third group, so now I have region, department and date. So, the problem I have now is I need to suppress the gh1 and gh2 when the date subtotal of the detail total field is > {?hours}. When I try to use your solution substituting ({@TOTAL}, {table.DATE}, "daily") for {@TOTAL}, I get an error when I put in the suppress formula on gh1 and gh2 saying it can't create the running total formula...

Any other thoughts? Thanks again for your help.
 
Shouldn't you also have an employee group? If you only want to show employees who work more than x number of hours per day, and you are including multiple dates, then you have to test results across these dates for each employee.

Are you adding a date group because the hours per day are coming not from just one record, but instead from multiple records? Please provide a sample of your detail-level results.

-LB
 
Yep, sorry. I have region, department, employee and date. I have to add the date because I can have multiple types of hours in a day, like regular, sick, training, etc. So I need to sum up all the hours within a day.

I have the employee and date group headers suppressed regardless. I need to suppress the department and region headers when I have no employees within that region and those departments where the employee's daily subtotal of hours is < {?hours).

So, I have


GH 1 - West Region
GH 2 - California
GH 3 - Joe Smith
GH 4 - 4/30/2004
Detail Worked - 4.00
Detail Training - 4.00
GF4 - Subtotal - 8.00
GF3 - nothing
GF2 - nothing
GF1 - nothing

I need to suppress GH1 and GH2 if there are no employees within a date range that don't meet the daily subtotal criteria.

Does that make sense? Thank you!
 
On further thought, I think you should change your approach and eliminate the suppression formulas, and instead use a group selection formula. Let's assume that you need to total multiple records within each date. I think you would need to insert an employee group between the department and date group. You would then go to report->edit selection formula->GROUP and enter:

sum({table.hours},{table.date}) > {?hours}

If hours appear in more than one field per record, then substitute a formula like the following for {table.hours} in the group select:

//{@totalhrs}:
{table.hours1} + {table.hours2} + {table.hours3}

The group selection formula should return only those dates per employee where they worked more than x number of hours. Group headings for groups 1,2,3, and 4 should not appear if there are no members of the group that meet the criterion.

-LB
 
Excellent! That worked. Thanks so much for your assistance! Your input on these boards is very helpful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top