| City | Project | Amount | Count |
|---|---|---|---|
| Neapolis | Army | 240.00 $ | 5 |
| Arts | 857.00 $ | 4 | |
| Arts | 933.00 $ | 5 | |
| Olympia | Army | 31.00 $ | 9 |
| Gladiators | 895.00 $ | 7 | |
| Taxes | 120.00 $ | 0 | |
| Roma | Army | 114.00 $ | 2 |
| Arts | 119.00 $ | 6 | |
| Arts | 399.00 $ | 3 | |
| Gladiators | 489.00 $ | 2 |
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 |
|---|---|---|---|
| Neapolis | Army | 240.00 $ | 5 |
| Arts | 857.00 $ | 4 | |
| Arts | 933.00 $ | 5 | |
| Neapolis subtotal | 2030.00 $ | 14 | |
| Olympia | Army | 31.00 $ | 9 |
| Gladiators | 895.00 $ | 7 | |
| Taxes | 120.00 $ | 0 | |
| Olympia subtotal | 1046.00 $ | 16 | |
| Roma | Army | 114.00 $ | 2 |
| Arts | 119.00 $ | 6 | |
| Arts | 399.00 $ | 3 | |
| Gladiators | 489.00 $ | 2 | |
| Roma subtotal | 1121.00 $ | 13 | |
| Total | 4197.00 $ | 43 |
Group by project and city, totals for amount only, customize labels.
| Project | City | Amount | Count |
|---|---|---|---|
| Army | Olympia | 31.00 $ | 9 |
| Roma | 114.00 $ | 2 | |
| Neapolis | 240.00 $ | 5 | |
| partial amount | 385.00 $ | ||
| Arts | Roma | 119.00 $ | 6 |
| 399.00 $ | 3 | ||
| Neapolis | 857.00 $ | 4 | |
| 933.00 $ | 5 | ||
| partial amount | 2308.00 $ | ||
| Gladiators | Roma | 489.00 $ | 2 |
| Olympia | 895.00 $ | 7 | |
| partial amount | 1384.00 $ | ||
| Taxes | 120.00 $ | 0 | |
| partial amount | 120.00 $ | ||
| full total | 4197.00 $ |
Totals for amount and count, without groups.
| City | Project | Amount | Count |
|---|---|---|---|
| Neapolis | Army | 240.00 $ | 5 |
| Neapolis | Arts | 857.00 $ | 4 |
| Neapolis | Arts | 933.00 $ | 5 |
| Olympia | Army | 31.00 $ | 9 |
| Olympia | Gladiators | 895.00 $ | 7 |
| Olympia | Taxes | 120.00 $ | 0 |
| Roma | Army | 114.00 $ | 2 |
| Roma | Arts | 119.00 $ | 6 |
| Roma | Arts | 399.00 $ | 3 |
| Roma | Gladiators | 489.00 $ | 2 |
| 4197.00 $ | 43 |