Warm tip: This article is reproduced from stackoverflow.com, please click
grouping crystal-reports report

Create a group from two columns

发布于 2020-03-29 20:59:37

I have this:

Column1  Column2  Column3
Water    1        2€
Water    2        3€
Water    2        5€
Milk     1        8€
Milk     1        4€
Milk     2        10€
Milk     3        1€

I am trying to group a column and sum the column to the side referring to the price.

And I want this:

Column1  Column2  Column3
Water    1        2€
Water    2        8€
Milk     1        12€
Milk     2        10€
Milk     3        1€

How can I do this?

Questioner
Raul Reis
Viewed
55
MatSnow 2020-01-31 18:17

Assuming that the datatype of Column2 is numeric, create a formula-field with the following content and then create a group from this field:

{Table.Column1} + "###" + CStr({Table.Column2})

Now just create the sum for Column3.

If necessary, change the string ### to something else, that will not appear in Column1 and Column2.