The generic data provided is rather vague, so I will provide my own to demonstrate (with field names on the first line)
"EmployeeName","WeekNumber","DayOfWeek","HoursWorked"
"John Doe",20,"Monday",8
"John Doe",20,"Tuesday",8
"John Doe",20,"Wednesday",8
"John Doe",21,"Thursday",8
"John Doe",21,"Friday",8
"Jane Doe",20,"Monday",8
"Jane Doe",20,"Tuesday",8
"Jane Doe",21,"Wednesday",8
"Jane Doe",21,"Thursday",8
"Jane Doe",21,"Friday",8
Assuming that I read the question correctly, you would want the report to look like this:
John Doe
Week: 20
Monday 8 hours
Tuesday 8 hours
Wednesday 8 hours
Week: 21
Thursday 8 hours
Friday 8 hours
Jane Doe
Week: 20
Monday 8 hours
Tuesday 8 hours
Week: 21
Wednesday 8 hours
Thursday 8 hours
Friday 8 hours
If this is the case, you would group by the "EmployeeName" field first, and then simply add another group for "WeekNumber" via the Insert menu using the Group option. This is pretty straightforward, and you can do summaries on the fields at various levels. The only thing that would get "hairy" with multiple tier of grouping would be if you were calculating fields within the group and wanted to return those calculations to a higher level of grouping for summation, which would require declaring global variables within the report.
For what it's worth, I've been using Crystal Reports heavily for the past 7 years.
Create a running total that counts records returned in your group, and have it reset on each change of group. How you do this depends on the version of CR you are using, but to my knowledge it is possible in about all of them. After that, you put the following in your suppression formula for GroupHeader4
:
// of course you would change '=' to '<='
// if you also want it to hide on 0
{#RunningTotalThatCountsRecords}=1;
This should work for most versions of Crystal Reports.
Best Answer
You either have to change your record source to group them the way you want.
Example:
OR
You could create a sub report for each group - each sub-report would select the same records except filter them to show only the particular group