| 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 subtotal | 591.00 $ | 6 | |
| Neapolis | Gladiators | 843.00 $ | 1 |
| Taxes | 263.00 $ | 9 | |
| Neapolis subtotal | 1106.00 $ | 10 | |
| Olympia | Gladiators | 371.00 $ | 6 |
| Olympia subtotal | 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 | |
| Roma subtotal | 2712.00 $ | 23 | |
| Total | 4780.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 amount | 820.00 $ | ||
| Arts | Roma | 348.00 $ | 5 |
| 494.00 $ | 5 | ||
| partial amount | 842.00 $ | ||
| Gladiators | Olympia | 371.00 $ | 6 |
| Neapolis | 843.00 $ | 1 | |
| partial amount | 1214.00 $ | ||
| Taxes | Roma | 144.00 $ | 6 |
| Neapolis | 263.00 $ | 9 | |
| Roma | 647.00 $ | 1 | |
| 850.00 $ | 4 | ||
| partial amount | 1904.00 $ | ||
| full total | 4780.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 |