In Crystal Reports 2013, I am developing a financial report that has multiple levels of grouping:
- Company Group (a collection of properties)
- Company (an individual property)
- Division (a group of departments that make up a division)
- Account Group (i.e. Revenue, Labor Costs, Operating Expenses, etc.)
- Account Sub-Group (just an additional break down of Account Group)
- Account Name (The name of a particular account range)
And this all works fine. However, I was given a change request for the report specifying that the level 6 grouping should be variable based on the level 4 grouping (i.e. If Account Group = Revenue then Account Name; if Account Group = Labor Costs then Department Name [IT, Accounting, etc]).
I have tried adding in a group 7 as the Department Name, conditionally suppressing Group 6 based on Group 4, but what happens is that in the groups where it is using the Department Name group (7), the department names are repeated for each Account Name. If I move the groups so that Department Name is 6 and Account Name is 7, then I have the problem in the one group is reporting off of the Account Name.
Here is a screen grab of the report structure with out the additional grouping, no repetition:
Here is a screen grab of the repetition that occurs when Department Name is used as group 7:
Finally, here is a grab of the repetition that occurs if Department Name is used as group 6:
My question is, how can I selectively group the report on either Account Name or Department Name (based on Account Group) without repeating the group type?
I know that this is an issue caused by the hierarchy of the grouping (i.e. multiple departments can use a single account type) so I need to figure out how to have the two groups at an equal level, with some sort of formula/code to decide which one to use.


