1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
%% my $default = { color => '#000000', size => 14 };
%% format(normal => $default.merge({}));
%% format(date => $default.merge({ num_format => 'd-mmm' }));
%% format(money => $default.merge({ bold => true(), num_format => '_(¥* #,##0.00_);_(¥* (#,##0.00);_(¥* -??_);_(@_)'}));
%% format(title => $default.merge({ bg_color => '#c6d9f0', pattern => 'solid' }));
%% format(bold => $default.merge({ bold => true() }));
%% format(bold_money => $default.merge({ bold => true(), num_format => '_(¥* #,##0.00_);_(¥* (#,##0.00);_(¥* -??_);_(@_)'}));
{
"selection" : 0,
"worksheets" : [
{
"column_widths" : [ 14.6, 18.5, 15.8, 12.2 ],
"name" : "Report 1",
"selection" : [ 1, 9 ],
"row_heights" : [ 25, 18, 18, 18 ],
"cells" : [
[
[% c("Descriptions", "title") %],
[% c("Numbers", "title") %],
[% c("Dates", "title") %],
[% c("Money", "title") %]
],
%% for $rows -> $row {
[
[% c($row.description, "normal") %],
[% c($row.number, "normal", "number") %],
[% c($row.date, "date", "date_time") %],
[% c($row.money, "money", "number") %]
],
%% }
[
[% c("Totals:", "bold") %],
[% c(
$rows.map(-> $a { $a.number }).reduce(-> $a, $b { $a + $b }),
"bold",
"number",
formula => 'SUM(B2:B' ~ ($rows.size() + 1) ~ ')',
) %],
[% c("", "bold") %],
[% c(
$rows.map(-> $a { $a.money }).reduce(-> $a, $b { $a + $b }),
"bold_money",
"number",
formula => 'SUM(D2:D' ~ ($rows.size() + 1) ~ ')',
) %]
]
]
}
]
}
|