From 7d42d369a80efceebb4114cd053f1cbbc2f8b4ce Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 24 Apr 2008 14:52:19 +0000 Subject: [PATCH] =?utf8?q?ReportGenerator:=20Unterst=C3=BCtzung=20f=C3=BCr?= =?utf8?q?=20das=20Verbinden=20von=20Tabellenzellen=20mit=20dem=20"colspan?= =?utf8?q?"-Attribut=20in=20der=20PDF-Ausgabe.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/ReportGenerator.pm | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 02c194070..0b74f8364 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -454,8 +454,17 @@ sub generate_pdf_content { push @cell_props, $cell_props_row; foreach my $custom_header_col (@{ $custom_header_row }) { - push @{ $data_row }, $custom_header_col->{text}; - push @{ $cell_props_row }, {}; + push @{ $data_row }, $custom_header_col->{text}; + + my $num_output = ($custom_header_col->{colspan} * 1 > 1) ? $custom_header_col->{colspan} : 1; + if ($num_output > 1) { + push @{ $data_row }, ('') x ($num_output - 1); + push @{ $cell_props_row }, { 'colspan' => $num_output }; + push @{ $cell_props_row }, ({ }) x ($num_output - 1); + + } else { + push @{ $cell_props_row }, {}; + } } } } @@ -478,8 +487,11 @@ sub generate_pdf_content { } foreach my $row (@{ $row_set }) { - $data_row = []; - push @data, $data_row; + $data_row = []; + $cell_props_row = []; + + push @data, $data_row; + push @cell_props, $cell_props_row; my $col_idx = 0; foreach my $col_name (@visible_columns) { @@ -488,14 +500,14 @@ sub generate_pdf_content { $column_props[$col_idx]->{justify} = 'right' if ($col->{align} eq 'right'); - $col_idx++; - } + my $cell_props = { }; + push @{ $cell_props_row }, $cell_props; - $cell_props_row = []; - push @cell_props, $cell_props_row; + if ($col->{colspan} && $col->{colspan} > 1) { + $cell_props->{colspan} = $col->{colspan}; + } - foreach (0 .. $num_columns - 1) { - push @{ $cell_props_row }, { }; + $col_idx++; } } } -- 2.20.1