Reputation: 1303
I have tricky question regarding Crystal reports. I have a data source that is basically like
DateGroupKey | Shop name | etc.
DateGroupKey =1 is this month, =2 is the previous month, =3 is the month before the previous. The trick is, every shop is only once in this list, in the most recent month, that had some activity. It is done with some sql magic, not the point of the question.
The report has two levels the top level looks like this:
This month (number of entries)
Previous month (number of entries)
Month before previous (number of entries)
No activity in the last 3 months (number of entries)
It has a @monthname
variable that has a formula like:
IF ISNULL({GetOrders.DateGroupKey}) THEN "No activity in the last 3 months"
ELSE IF {GetOrders.DateGroupKey}=0 THEN "This month"
ELSE IF {GetOrders.DateGroupKey}=1 THEN "Previous month "
ELSE IF {GetOrders.DateGroupKey}=2 THEN "Month before previous "
The ground level looks like a list. If you double click on the 'This month' it will show only those records. This is well and good so far.
Now the question, if there are no entries for example with the DateGroupKey 1 there will be no group header 'Previous month'. I would like to have a group header displayed (even with 0 entries). How can I do that?
Thank you for your help! Sziro
Edit: picture of the design:
Upvotes: 0
Views: 1591
Reputation: 2750
This is a tricky one. If there is no data for a particular scenario, then CR doesn't know that there actually is a group. What you will have to do is create a dummy table that has one column that lists all your possible groups. You will have to add that to your report and then outer-join your real data table to the dummy table. That should give you all your data with a group for each one even if there is no data for a group.
Upvotes: 1