Code source wiki de Summary Macro
Modifié par Paul Libbrecht (admin) le 2021/12/12 21:39
Afficher les derniers auteurs
author | version | line-number | content |
---|---|---|---|
1 | This macro allows to generate a summary table from multiple tables and is compatible with the SUM and CALC macros | ||
2 | |||
3 | = Macro Parameters = | ||
4 | |||
5 | {{velocity}} | ||
6 | |=Parameter|=Description|=Possible values|=Default value | ||
7 | |type|Heading or Aggregate grouping|heading or column|heading | ||
8 | |title|Title line to use for the summary table||A standard title line is used by default | ||
9 | |summarytitle|Summary title to use for the summary table for the full summary line||The text "Total" is used by default | ||
10 | |format1|Display format of the first element of the grouping. This uses DecimalFormat from java|0.00 days|0.00 | ||
11 | |format2|Display format of the second element of the grouping. This uses DecimalFormat from java|0.00 Euros|0.00 | ||
12 | |||
13 | In mode "heading", elements are grouped by the heading of the section in which the table is. The second and third column values of the last row of each table is used for the aggragation as shown in the sample. | ||
14 | |||
15 | In mode "column", elements are grouped by the value of the first column. The second and third column values of each row of each tables are aggregated except the last row of each table. | ||
16 | {{/velocity}} | ||
17 | |||
18 | == Section 1 == | ||
19 | |||
20 | This work requires the following workload | ||
21 | |||
22 | |=Description|=Number of days|=Price per day|=Total | ||
23 | |Project Manager|4| 800 Euros |={{calc formula="$B*$C" format="0 Euros"/}} | ||
24 | |Designer|1.5| 600 Euros |={{calc formula="$B*$C" format="0 Euros"/}} | ||
25 | |=Total|={{sum type="col" format="0.0 days"/}}||={{sum type="col" format="0 Euros"/}} | ||
26 | |||
27 | == Section 2 == | ||
28 | |||
29 | |=Description|=Number of days|=Price per day|=Total | ||
30 | |Project Manager|3|800 Euros|={{calc formula="$B*$C" format="0 Euros"/}} | ||
31 | |Designer|2|600 Euros|={{calc formula="$B*$C" format="0 Euros"/}} | ||
32 | |=Total|={{sum type="col" format="0.0 days"/}}||={{sum type="col" format="0 Euros"/}} | ||
33 | |||
34 | == Section 3 == | ||
35 | |||
36 | |=Description|=Number of days|=Price per day|=Total | ||
37 | |Project Manager|3| 800 Euros |={{calc formula="$B*$C" format="0 Euros"/}} | ||
38 | |Designer|2| 600 Euros |={{calc formula="$B*$C" format="0"/}} Euros | ||
39 | |=Total|={{sum type="col" format="0.0 days"/}}| 720 Euros |={{calc formula="$B*$C" format="0 Euros"/}} | ||
40 | |||
41 | == Total == | ||
42 | |||
43 | {{summary format1="0.0 days" format2="0 Euros"/}} | ||
44 | |||
45 | {{summary type="column" format1="0.0 days" format2="0 Euros"/}} |