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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
<%doc>
The "printable" view (all groups on one page).
</%doc>
<%init>
my %opt = @_;
my $group_info = $m->comp('core', %opt,
'show_combined' => 0
);
my $ncols = scalar(@{ $opt{header} });
my $total_footer = $group_info->{total_footer} || [];
</%init>
<& /elements/header-popup.html, $opt{title} &>
<STYLE>
.grouphead {
text-align: left;
font-size: 120%;
padding: 1ex 0 0.5ex 0.1ex;
border-top: 1px solid black;
}
.subtotal td {
background-color: #dddddd;
font-style: italic;
border-top: 1px dashed black;
}
.total td {
background-color: #dddddd;
font-style: italic;
font-weight: bold;
border-top: 2px solid black !important;
}
</STYLE>
<& /elements/table-grid.html &>
<THEAD>
<& /search/elements/search-html.html:header_row,
'header' => $opt{'header'},
'header2' => $opt{'header2'},
'sort_fields' => ($opt{'sort_fields'} || $opt{'fields'}),
&>
</THEAD>
% for (my $curr_group = 0; $curr_group < $group_info->{num}; $curr_group++) {
% my $group = $group_info->{groups}[$curr_group];
% my $query = $group_info->{queries}[$curr_group];
% my $footer = $group_info->{group_footers}[$curr_group];
% my $label = $group_info->{group_labels}[$curr_group];
% # run the query
% my @rows = $query->qsearch;
% #warn Dumper(\@rows); #DEBUG
<TBODY>
<TR><TH CLASS="grouphead" COLSPAN="<% $ncols %>">
<% $label %>
</TH></TR>
<& /search/elements/search-html.html:data_rows,
rows => \@rows,
opt => \%opt,
&>
</TBODY>
<TBODY CLASS="subtotal">
<& /search/elements/search-html.html:footer_row,
row => $footer,
opt => \%opt,
&>
</TBODY>
% } # for $curr_group
% if ( scalar @$total_footer ) {
<TFOOT CLASS="total">
<& /search/elements/search-html.html:footer_row,
row => $total_footer,
opt => \%opt,
&>
</TFOOT>
% }
</TABLE>
<& /elements/footer.html &>
|