There are a few options that control how the grouping is done. By default, the grouping columns are shown in full. The first example would actually be rendered as the following by default:
A 1
A 2
3
B 1
B 4
5
Total 8
It is possible to control whether an extra row, containing the group headers (the values of the grouping column), is added before each section. By default this is turned off. If we turn it on, the result would look like the following:
A
A 1
A 2
3
B
B 1
B 4
5
Total 8
Grand Total Label property controls the label of the table summarization row. If it is set, the label is added to the table summarization row (grand total) as the first cell value.
A
1
2
3
B
1
4
5
Total 8
If we do not want to add an additional row for the group headers, we can set the option 'Group Header In Place', so the above table would look like the following:
A 1
2
3
B 1
4
5
Total 8
Although it is possible to implement Grouping and Summarization programmatically, the recommended way is to use the Report Designer GUI. See the Report Creation With Grouping/Summarization chapter for a complete example.