X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/078fa02aa17feb2560a76b54a9c98c8c98957de5..330cfa6d7507da52bc1c2a3874b46eb23255538f:/SL/ReportGenerator.pm diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 34ef2b5cf..2273c2e6b 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++; } } } @@ -595,6 +607,7 @@ sub generate_pdf_content { }, 'column_props' => \@column_props, 'cell_props' => \@cell_props, + 'max_word_length' => 60, ); foreach my $page_num (1..$pdf->pages()) { @@ -707,8 +720,7 @@ sub generate_csv_content { } else { foreach my $row (@{ $self->{custom_headers} }) { - my $fields = [ ]; - my $skip_next = 0; + my $fields = [ ]; foreach my $col (@{ $row }) { my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;