foreach my $column (values %{ $self->{columns} }) {
$column->{visible} = $self->{options}->{std_column_visibility} unless defined $column->{visible};
}
-
+
if( $::form->{report_generator_csv_options_for_import} ) {
foreach my $key (keys %{ $self->{columns} }) {
$self->{columns}{$key}{text} = $key;
}
sub generate_with_headers {
- my $self = shift;
+ my ($self, %params) = @_;
my $format = lc $self->{options}->{output_format};
my $form = $self->{form};
if ($format eq 'html') {
my $title = $form->{title};
$form->{title} = $self->{title} if ($self->{title});
- $form->header();
+ $form->header(no_layout => $params{no_layout});
$form->{title} = $title;
print $self->generate_html_content();
$col->{CELL_ROWS} = [ ];
foreach my $i (0 .. scalar(@{ $col->{data} }) - 1) {
push @{ $col->{CELL_ROWS} }, {
- 'data' => $self->html_format($col->{data}->[$i]),
+ 'data' => '' . $self->html_format($col->{data}->[$i]),
'link' => $col->{link}->[$i],
};
}
my $self = shift;
my $variables = $self->prepare_html_content();
- return $self->{form}->parse_html_template($self->{options}->{html_template}, $variables);
+ my $stuff = $self->{form}->parse_html_template($self->{options}->{html_template}, $variables);
+ return $stuff;
}
sub _cm2bp {
my $num_columns = scalar @visible_columns;
my $num_header_rows = 1;
- my $font_encoding = $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15';
+ my $font_encoding = 'UTF-8';
foreach my $name (@visible_columns) {
push @column_props, { 'justify' => $self->{columns}->{$name}->{align} eq 'right' ? 'right' : 'left' };
my ($self, $text, $do_unquote) = @_;
$text = $main::locale->unquote_special_chars('HTML', $text) if $do_unquote;
- $text = Encode::encode('UTF-8', $text) if $::locale->is_utf8;
+ $text = Encode::encode('UTF-8', $text);
return $text;
}
=head1 NAME
-SL::ReportGenerator.pm: the Lx-Office way of getting data in shape
+SL::ReportGenerator.pm: the kivitendo way of getting data in shape
=head1 SYNOPSIS
Then it lacks usability. You want it to be able to sort the data. You add code for that.
Then there are too many results, you need pagination, you want to print or export that data..... and so on.
-The ReportGenerator class was designed because this exact scenario happened about half a dozen times in Lx-Office.
+The ReportGenerator class was designed because this exact scenario happened about half a dozen times in kivitendo.
It's purpose is to manage all those formating, culling, sorting, and templating.
Which makes it almost as complicated to use as doing the work for yourself.