X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0eb1af1c58e920e15011c485642183d99adec3a8..86e5dc5018345f284e64dd0b414c3d2865a16c51:/SL/ReportGenerator.pm diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 746945108..67d69a9be 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -231,7 +231,7 @@ sub get_visible_columns { my $self = shift; my $format = shift; - return grep { my $c = $self->{columns}->{$_}; $c && $c->{visible} && (($c->{visible} == 1) || ($c->{visible} =~ /${format}/i)) } @{ $self->{column_order} }; + return grep { my $c = $self->{columns}->{$_}; $c && $c->{visible} && (($c->{visible} == 1) || ($c->{visible} =~ /\Q${format}\E/i)) } @{ $self->{column_order} }; } sub html_format { @@ -268,20 +268,33 @@ sub prepare_html_content { } my ($outer_idx, $inner_idx) = (0, 0); + my $next_border_top; my @rows; foreach my $row_set (@{ $self->{data} }) { if ('HASH' eq ref $row_set) { + if ($row_set->{type} eq 'separator') { + if (! scalar @rows) { + $next_border_top = 1; + } else { + $rows[-1]->{BORDER_BOTTOM} = 1; + } + + next; + } + my $row_data = { 'IS_CONTROL' => 1, - 'IS_SEPARATOR' => $row_set->{type} eq 'separator', 'IS_COLSPAN_DATA' => $row_set->{type} eq 'colspan_data', 'NUM_COLUMNS' => scalar @visible_columns, + 'BORDER_TOP' => $next_border_top, 'data' => $row_set->{data}, }; push @rows, $row_data; + $next_border_top = 0; + next; } @@ -298,7 +311,15 @@ sub prepare_html_content { 'data' => $self->html_format($col->{data}->[$i]), 'link' => $col->{link}->[$i], }; - }; + } + + # Force at least a   to be displayed so that browsers + # will format the table cell (e.g. borders etc). + if (!scalar @{ $col->{CELL_ROWS} }) { + push @{ $col->{CELL_ROWS} }, { 'data' => ' ' }; + } elsif ((1 == scalar @{ $col->{CELL_ROWS} }) && !$col->{CELL_ROWS}->[0]->{data}) { + $col->{CELL_ROWS}->[0]->{data} = ' '; + } } my $row_data = { @@ -306,9 +327,12 @@ sub prepare_html_content { 'outer_idx' => $outer_idx, 'outer_idx_odd' => $outer_idx % 2, 'inner_idx' => $inner_idx, + 'BORDER_TOP' => $next_border_top, }; push @rows, $row_data; + + $next_border_top = 0; } } @@ -344,7 +368,7 @@ sub generate_html_content { my $self = shift; my $variables = $self->prepare_html_content(); - return $self->{form}->parse_html_template2('report_generator/html_report', $variables); + return $self->{form}->parse_html_template('report_generator/html_report', $variables); } sub verify_paper_size {