Subtotal Group by Class
Subtotal Group by Class
obworley
Posts: 7Questions: 2Answers: 0
Is it possible find a subtotal on a group by class? I need to only subtotal certain columns, but want the same instance of DataTables to work on multiple reports. I've found some examples, but they all name the column that needs to be subtotaled.
This discussion has been closed.
Answers
I figured out a work around. It's not elegant, but I'll leave it here for anyone else who is trying to dynamically sum by group (I put the totals below the group). It also detects if the subtotal should be a number or a currency and formats accordingly.
Sum will show a subtotal, dol will format the subtotal as currency. The "sum" and/or "dol" classes are on the td cells in the tbody. I use the same detection method for the totals in the footer.
I used a number of different references and it took two days so I I'm not sure who all helped me. Thank you to all of you!