Adding subtotals to SSRS report tablix

2019-06-16 03:55发布

问题:

say i have this record..

lastname  firstname  mi  checkno  amount  totalamount

lastname1 firstname1 mi1 k1234    5000
lastname2 firstname2 mi2 k1234    5000
lastname3 firstname3 mi3 k1234    5000
lastname4 firstname4 mi4 k90788   5000
lastname5 firstname5 mi5 k90788   5000
lastname6 firstname6 mi6 k90789   5000
                                          30000   

can i make this record to look like the following in ssrs?

lastname  firstname  mi  checkno  amount  totalamount

lastname1 firstname1 mi1 k1234    5000
lastname2 firstname2 mi2 k1234    5000
lastname3 firstname3 mi3 k1234    5000
                                          15000
lastname4 firstname4 mi4 k90788   5000
lastname5 firstname5 mi5 k90788   5000
                                          10000
lastname6 firstname6 mi6 k90789   5000
                                           5000   

hope anyone can help me fix this. thank you

回答1:

First, add a row group to your tablix:

Specify that grouping should by on column "checkno", and also add a footer to the group (to hold the subtotals):

Finally, add the sum calculation in the group footer. Optionally remove the left-most column containing the group header name:

Èt voila: