Subject: | totals not correct over 10 columns |
DBIx-XHTML_Table-1.36
---------------
no error message, but totals do not appear under the column that they match. Works from 1-9 columns then gets funky above 11 columns.
---------------
problem: value returned from _total_chunk is not in same order as original columns.
----------------
fix:
add {$a <=> $b} to 'map' line in _total_chunk to force numerical sort of columns.
# used by calc_totals() and calc_subtotals()
sub _total_chunk {
my ($self,$chunk,$indexes) = @_;
my %totals;
foreach my $row (@$chunk) {
foreach (@$indexes) {
$totals{$_} += $row->[$_] if $row->[$_] =~ /^[-0-9\.]+$/; }
}
return [ map { defined $totals{$_} ? $totals{$_} : undef } sort { $a <=> $b} (0..$self->get_col_count() - 1) ];
}
-----------------------
This module has been a real timesaver for me. Thank you for the time you have put into it already. Hope this report is useful......