0
votes

In Crystal Reports 2013, I am developing a financial report that has multiple levels of grouping:

  1. Company Group (a collection of properties)
  2. Company (an individual property)
  3. Division (a group of departments that make up a division)
  4. Account Group (i.e. Revenue, Labor Costs, Operating Expenses, etc.)
  5. Account Sub-Group (just an additional break down of Account Group)
  6. 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:

With no additional Grouping

Here is a screen grab of the repetition that occurs when Department Name is used as group 7:

Repetition in Group 7

Finally, here is a grab of the repetition that occurs if Department Name is used as group 6:

Repetition in 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.

1

1 Answers

2
votes

Actually your approach is wrong....you can't split a group by making it a subgroup of the original group (group 6 and group 7)

You need to write a simple if condition and change the group. For group 6 write formula as below and group using that formula

If account="revenue"
Then account name
Else if account= "labour"
Then department

Create the 6th group with this formula,this automatically change the group6 display as per the account group