0
votes

I am fairly new to Crystal Reports, and I am having a grouping problem. I am trying to create a recap report that only shows a summary of fields that are grouped together based on three different criteria. In order to be included in the sum, the fields ({TABLE.HS}, {TABLE.ORIGIN}, {TABLE.TREATMENT},{TABLE.VALUE}) must be grouped together -- if the {TABLE.HS} are the same AND the {TABLE.ORIGIN} are the same AND the {TABLE.TREATMENT} are the same, then I want it to show one line where the {TABLE.VALUE} is totaled. If any of the fields differ, then it should be in a new group.

Example:

RECORD 1: HS = 4911, ORIGIN = USA, TREATMENT = 02, VALUE = $1
RECORD 2: HS = 4911, ORIGIN = USA, TREATMENT = 02, VALUE = $5
RECORD 3: HS = 3926, ORIGIN = USA, TREATEMENT = 02, VALUE = $2

I want the detail lines to show:

DETAIL 1:  HS = 4911, ORIGIN = USA, TREATMENT = 02, VALUE = $6
DETAIL 2:  HS = 3926, ORIGIN = USA, TREATMENT = 02, VALUE = $2

If someone could point me in the right direction, I would greatly appreciate it.

1

1 Answers

0
votes

Note: This is untested

To the extent I understand your problem below is the solution.

Group the report as following:
1. Group 1: Origin
2. Group 2: Treatement
3. Group 3: HS

value in detail and take summary of the value in all group footers and report footer

I am suggesting this solution because your requirement is dynamic where you can get (Origin, Treatment, HS) as same or different.