Column summation

City Project Amount Count
Carthago Arts 297.00 $ 2
Arts 686.00 $ 3
Neapolis Arts 105.00 $ 9
Arts 612.00 $ 7
Gladiators 398.00 $ 4
Gladiators 587.00 $ 0
Olympia Gladiators 54.00 $ 6
Roma Army 397.00 $ 2
Arts 263.00 $ 9
Arts 993.00 $ 6

The table above shows a simple report, grouped by the "city" value, and with some amount.

The following tables are based on the same code, with the only addition of a table decorator org.displaytag.decorator.TotalTableDecorator.

The decorator will generate totals for any column with the total attribute set, and subtotal rows by grouping using the column with a group attribute set to 1.


Group by city, total for amount and count

City Project Amount Count
Carthago Arts 297.00 $ 2
Arts 686.00 $ 3
Carthago subtotal983.00 $5
Neapolis Arts 105.00 $ 9
Arts 612.00 $ 7
Gladiators 398.00 $ 4
Gladiators 587.00 $ 0
Neapolis subtotal1702.00 $20
Olympia Gladiators 54.00 $ 6
Olympia subtotal54.00 $6
Roma Army 397.00 $ 2
Arts 263.00 $ 9
Arts 993.00 $ 6
Roma subtotal1653.00 $17
Total4392.00 $48

Group by project and city, totals for amount only, customize labels.

Project City Amount Count
Army Roma 397.00 $ 2
partial amount397.00 $
Arts Neapolis 105.00 $ 9
Roma 263.00 $ 9
Carthago 297.00 $ 2
Neapolis 612.00 $ 7
Carthago 686.00 $ 3
Roma 993.00 $ 6
partial amount2956.00 $
Gladiators Olympia 54.00 $ 6
Neapolis 398.00 $ 4
587.00 $ 0
partial amount1039.00 $
full total4392.00 $

Totals for amount and count, without groups.

City Project Amount Count
Carthago Arts 297.00 $ 2
Carthago Arts 686.00 $ 3
Neapolis Arts 105.00 $ 9
Neapolis Arts 612.00 $ 7
Neapolis Gladiators 398.00 $ 4
Neapolis Gladiators 587.00 $ 0
Olympia Gladiators 54.00 $ 6
Roma Army 397.00 $ 2
Roma Arts 263.00 $ 9
Roma Arts 993.00 $ 6
4392.00 $48