Subtotal in report

for the aging report.we need to add subtotal on the sorting of the report by purpose.sorting comes but as usual in ascending order.I want to add subtotal for each sorting.