Column summation

City Project Amount Count
Carthago Army 591.00 $ 6
Neapolis Gladiators 843.00 $ 1
Taxes 263.00 $ 9
Olympia Gladiators 371.00 $ 6
Roma Army 229.00 $ 2
Arts 348.00 $ 5
Arts 494.00 $ 5
Taxes 144.00 $ 6
Taxes 647.00 $ 1
Taxes 850.00 $ 4

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 Army 591.00 $ 6
Carthago subtotal591.00 $6
Neapolis Gladiators 843.00 $ 1
Taxes 263.00 $ 9
Neapolis subtotal1106.00 $10
Olympia Gladiators 371.00 $ 6
Olympia subtotal371.00 $6
Roma Army 229.00 $ 2
Arts 348.00 $ 5
Arts 494.00 $ 5
Taxes 144.00 $ 6
Taxes 647.00 $ 1
Taxes 850.00 $ 4
Roma subtotal2712.00 $23
Total4780.00 $45

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

Project City Amount Count
Army Roma 229.00 $ 2
Carthago 591.00 $ 6
partial amount820.00 $
Arts Roma 348.00 $ 5
494.00 $ 5
partial amount842.00 $
Gladiators Olympia 371.00 $ 6
Neapolis 843.00 $ 1
partial amount1214.00 $
Taxes Roma 144.00 $ 6
Neapolis 263.00 $ 9
Roma 647.00 $ 1
850.00 $ 4
partial amount1904.00 $
full total4780.00 $

Totals for amount and count, without groups.

City Project Amount Count
Carthago Army 591.00 $ 6
Neapolis Gladiators 843.00 $ 1
Neapolis Taxes 263.00 $ 9
Olympia Gladiators 371.00 $ 6
Roma Army 229.00 $ 2
Roma Arts 348.00 $ 5
Roma Arts 494.00 $ 5
Roma Taxes 144.00 $ 6
Roma Taxes 647.00 $ 1
Roma Taxes 850.00 $ 4
4780.00 $45