Search code examples
crystal-reportscrystal-reports-2010

Grouping report columns


I have the following data loaded in to crystal report

ID  Name            Amt     Cat_1   Cat_2
==  ====            =====   =====   =====
001 CASH            20.00   NULL    NULL
001 CASH            30.00   NULL    NULL
001 CASH            44.00   NULL    NULL
002 CHEQUE          110.00  001     NULL
003 ELECR TRASFERS  6.00    001     NULL

I want to group these records by their ID and the amount field should then be totaled. It needs to be like when we do a standard GROUP BY ID on SQL.

I used the group expert on Crystal Report & Selected the ID field from the drop-down. Then the grouping worked properly but the Amt is shown as 20 instead it needs to be 94.


Solution

  • If you need to get the Sum don't place the amt in group header which will pick only first value.

    To get the required outout place the amt in detail and take sum in group footer.