\n";
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
unless (exists $self->{'noheader'}) { |
49
|
0
|
|
|
|
|
|
$self->staticTableHeader($spec, $mode, $sortHeader); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
print "\n"; |
53
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
if (ref($data) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# autodetermine rowspan drivers and call setRowspanDriver() from the first row of data |
57
|
0
|
0
|
|
|
|
|
if(scalar(@$data)) { |
58
|
0
|
|
|
|
|
|
foreach my $dbfield (keys %{$data->[0]}) { |
|
0
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
if (ref($data->[0]->{$dbfield}) eq 'ARRAY') { |
60
|
0
|
|
|
|
|
|
push @{$self->{variableRowspanDriver}}, $dbfield; |
|
0
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
foreach my $row (@$data) { |
66
|
|
|
|
|
|
|
|
67
|
0
|
0
|
|
|
|
|
if (exists $self->{variableRowspanDriver}) { |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $maxRowspanSubcount = 0; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
for (my $j = 0; $j < scalar(@{$self->{variableRowspanDriver}}); $j++) { |
|
0
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
if (ref($row->{$self->{variableRowspanDriver}->[$j]}) eq 'ARRAY') { |
73
|
0
|
|
|
|
|
|
my $nextRowspanSubcount = scalar(@{$row->{$self->{variableRowspanDriver}->[$j]}}); |
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
0
|
0
|
|
|
|
|
if ($nextRowspanSubcount > $maxRowspanSubcount) { |
76
|
0
|
|
|
|
|
|
$maxRowspanSubcount = $nextRowspanSubcount; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
for (my $i = 0; $i < $maxRowspanSubcount; $i++) { |
82
|
0
|
|
|
|
|
|
print " |
";
83
|
0
|
|
|
|
|
|
$self->staticTableRow($row, $spec, $maxRowspanSubcount, $i); |
84
|
0
|
|
|
|
|
|
print " |
\n\n";
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { |
88
|
0
|
|
|
|
|
|
print " |
";
89
|
0
|
|
|
|
|
|
$self->staticTableRow($row, $spec); |
90
|
0
|
|
|
|
|
|
print " |
\n\n";
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
elsif (ref($data) eq 'HASH') { |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# autodetermine rowspan drivers and call setRowspanDriver() from the first row of data |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
my ($key, $row) = each %$data; |
99
|
|
|
|
|
|
|
|
100
|
0
|
0
|
|
|
|
|
if($row) { |
101
|
0
|
|
|
|
|
|
foreach my $dbfield (keys %$row) { |
102
|
0
|
0
|
|
|
|
|
if (ref($row->{$dbfield}) eq 'ARRAY') { |
103
|
0
|
|
|
|
|
|
push @{$self->{variableRowspanDriver}}, $dbfield; |
|
0
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
0
|
0
|
|
|
|
|
if ( my $so = $self->{'sortOrder'}) { |
109
|
|
|
|
|
|
|
|
110
|
0
|
0
|
|
|
|
|
foreach my $rowKey (sort { my $aPos; my $bPos; for ($aPos = 0; $aPos < scalar(@$so); $aPos++) { if ($so->[$aPos] eq $a) { last; } } for ($bPos = 0; $bPos < scalar(@$so); $bPos++) { if ($so->[$bPos] eq $b) { last; } } $aPos <=> $bPos; } keys %$data) { |
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
my $row = $data->{$rowKey}; |
113
|
|
|
|
|
|
|
|
114
|
0
|
0
|
|
|
|
|
if (exists $self->{variableRowspanDriver}) { |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
my $maxRowspanSubcount = 0; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
for (my $j = 0; $j < scalar(@{$self->{variableRowspanDriver}}); $j++) { |
|
0
|
|
|
|
|
|
|
119
|
0
|
0
|
|
|
|
|
if (ref($row->{$self->{variableRowspanDriver}->[$j]}) eq 'ARRAY') { |
120
|
0
|
|
|
|
|
|
my $nextRowspanSubcount = scalar(@{$row->{$self->{variableRowspanDriver}->[$j]}}); |
|
0
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
0
|
0
|
|
|
|
|
if ($nextRowspanSubcount > $maxRowspanSubcount) { |
123
|
0
|
|
|
|
|
|
$maxRowspanSubcount = $nextRowspanSubcount; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
for (my $i = 0; $i < $maxRowspanSubcount; $i++) { |
129
|
0
|
|
|
|
|
|
print " |
";
130
|
0
|
|
|
|
|
|
$self->staticTableRow($row, $spec, $maxRowspanSubcount, $i); |
131
|
0
|
|
|
|
|
|
print " |
\n\n";
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
else { |
135
|
0
|
|
|
|
|
|
print " |
";
136
|
0
|
|
|
|
|
|
$self->staticTableRow($row, $spec); |
137
|
0
|
|
|
|
|
|
print " |
\n\n";
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
else { |
142
|
0
|
|
|
|
|
|
foreach my $rowKey (sort keys %$data) { |
143
|
0
|
|
|
|
|
|
print " |
";
144
|
0
|
|
|
|
|
|
$self->staticTableRow($data->{$rowKey}, $spec); |
145
|
0
|
|
|
|
|
|
print " |
\n";
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
else { |
151
|
0
|
|
|
|
|
|
confess "data must by a hash or array reference, not a " . ref($data); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
print " |
\n";