Ching29
Ching29

Reputation: 516

How can I summarize grouped parameter in crystal?

I have a Stored Proc that executes and outputs like this,

Plant1     Top1       12
Plant1     Bottom1    12
Plant1     Top2       14
Plant1     Bottom12   14
Plant2     Top1       34
Plant2     Bottom1    34
Plant2     Top2       18
Plant2     Bottom12   18

and I want it to be displayed like this in the Crystal Report.

Plant1
   Top
     Top1        12
     Top2        14
   Bottom
      Bottom1    12
      Bottom1    14

Plant2
   Top
     Top1        34
     Top2        18
   Bottom
      Bottom1    34
      Bottom1    18

Total
   Top
     Top1        46
     Top2        32
   Bottom
      Bottom1    46
      Bottom1    32

I already found a way to display the Plant1 and Plant2. I am asking for a help in displaying the total.. By the way, I am using Crystal Report 9. I'll be so thankful for any help..

Upvotes: 0

Views: 63

Answers (1)

vice
vice

Reputation: 605

If you are always going to have one number on the end of your TopX/BottomX field, then you can make a formula to trim the number from the field leaving you with Top/Bottom. You would then be able to group on this formula.

An example of this would be:

left({Table.Variable}, length({Table.Variable})-1)

Where {Table.Variable} is your StoredProcedure.Fieldname for the Top/Bottom field.

If you then group on Plant then this formula, then display your values and Top/Bottom in the Details section you will get the desired behaviour. You may have to change your sorting options to get Top to appear before Bottom.

Upvotes: 1

Related Questions