1 package SL::ReportGenerator;
4 use List::Util qw(max);
10 # Cause locales.pl to parse these files:
11 # parse_html_template('report_generator/html_report')
18 $self->{myconfig} = shift;
19 $self->{form} = shift;
23 'std_column_visibility' => 0,
24 'output_format' => 'HTML',
25 'allow_pdf_export' => 1,
26 'allow_csv_export' => 1,
27 'html_template' => 'report_generator/html_report',
30 'orientation' => 'landscape',
31 'font_name' => 'Verdana',
35 'margin_bottom' => 1.5,
36 'margin_right' => 1.5,
46 'eol_style' => 'Unix',
52 'variable_list' => [],
55 $self->{data_present} = 0;
59 $self->set_options(@_) if (@_);
68 $self->{columns} = \%columns;
70 foreach my $column (values %{ $self->{columns} }) {
71 $column->{visible} = $self->{options}->{std_column_visibility} unless defined $column->{visible};
74 $self->set_column_order(sort keys %{ $self->{columns} });
77 sub set_column_order {
80 $self->{column_order} = [ grep { !$seen{$_}++ } @_, sort keys %{ $self->{columns} } ];
83 sub set_sort_indicator {
86 $self->{options}->{sort_indicator_column} = shift;
87 $self->{options}->{sort_indicator_direction} = shift;
95 while (my $arg = shift) {
98 if ('ARRAY' eq ref $arg) {
101 } elsif ('HASH' eq ref $arg) {
105 $self->{form}->error('Incorrect usage -- expecting hash or array ref');
108 my @columns_with_default_alignment = grep { defined $self->{columns}->{$_}->{align} } keys %{ $self->{columns} };
110 foreach my $row (@{ $row_set }) {
111 foreach my $column (@columns_with_default_alignment) {
112 $row->{$column} ||= { };
113 $row->{$column}->{align} = $self->{columns}->{$column}->{align} unless (defined $row->{$column}->{align});
116 foreach my $field (qw(data link)) {
117 map { $row->{$_}->{$field} = [ $row->{$_}->{$field} ] if (ref $row->{$_}->{$field} ne 'ARRAY') } keys %{ $row };
121 push @{ $self->{data} }, $row_set;
122 $last_row_set = $row_set;
124 $self->{data_present} = 1;
127 return $last_row_set;
133 push @{ $self->{data} }, { 'type' => 'separator' };
140 push @{ $self->{data} }, $data;
147 $self->{data_present} = 0;
154 while (my ($key, $value) = each %options) {
155 if ($key eq 'pdf_export') {
156 map { $self->{options}->{pdf_export}->{$_} = $value->{$_} } keys %{ $value };
158 $self->{options}->{$key} = $value;
163 sub set_options_from_form {
166 my $form = $self->{form};
167 my $myconfig = $self->{myconfig};
169 foreach my $key (qw(output_format)) {
170 my $full_key = "report_generator_${key}";
171 $self->{options}->{$key} = $form->{$full_key} if (defined $form->{$full_key});
174 foreach my $format (qw(pdf csv)) {
175 my $opts = $self->{options}->{"${format}_export"};
176 foreach my $key (keys %{ $opts }) {
177 my $full_key = "report_generator_${format}_options_${key}";
178 $opts->{$key} = $key =~ /^margin/ ? $form->parse_amount($myconfig, $form->{$full_key}) : $form->{$full_key};
183 sub set_export_options {
188 'variable_list' => [ @_ ],
192 sub set_custom_headers {
196 $self->{custom_headers} = [ @_ ];
198 delete $self->{custom_headers};
202 sub get_attachment_basename {
204 my $filename = $self->{options}->{attachment_basename} || 'report';
205 $filename =~ s|.*\\||;
206 $filename =~ s|.*/||;
211 sub generate_with_headers {
213 my $format = lc $self->{options}->{output_format};
214 my $form = $self->{form};
216 if (!$self->{columns}) {
217 $form->error('Incorrect usage -- no columns specified');
220 if ($format eq 'html') {
221 my $title = $form->{title};
222 $form->{title} = $self->{title} if ($self->{title});
224 $form->{title} = $title;
226 print $self->generate_html_content();
228 } elsif ($format eq 'csv') {
229 my $filename = $self->get_attachment_basename();
230 print qq|content-type: text/csv\n|;
231 print qq|content-disposition: attachment; filename=${filename}.csv\n\n|;
232 $self->generate_csv_content();
234 } elsif ($format eq 'pdf') {
235 $self->generate_pdf_content();
238 $form->error('Incorrect usage -- unknown format (supported are HTML, CSV, PDF)');
242 sub get_visible_columns {
246 return grep { my $c = $self->{columns}->{$_}; $c && $c->{visible} && (($c->{visible} == 1) || ($c->{visible} =~ /\Q${format}\E/i)) } @{ $self->{column_order} };
253 $value = $main::locale->quote_special_chars('HTML', $value);
255 $value =~ s/\n/<br>/g;
260 sub prepare_html_content {
263 my ($column, $name, @column_headers);
265 my $opts = $self->{options};
266 my @visible_columns = $self->get_visible_columns('HTML');
268 foreach $name (@visible_columns) {
269 $column = $self->{columns}->{$name};
273 'link' => $column->{link},
274 'text' => $column->{text},
275 'show_sort_indicator' => $name eq $opts->{sort_indicator_column},
276 'sort_indicator_direction' => $opts->{sort_indicator_direction},
279 push @column_headers, $header;
283 if ($self->{custom_headers}) {
284 $header_rows = $self->{custom_headers};
286 $header_rows = [ \@column_headers ];
289 my ($outer_idx, $inner_idx) = (0, 0);
293 foreach my $row_set (@{ $self->{data} }) {
294 if ('HASH' eq ref $row_set) {
295 if ($row_set->{type} eq 'separator') {
296 if (! scalar @rows) {
297 $next_border_top = 1;
299 $rows[-1]->{BORDER_BOTTOM} = 1;
307 'IS_COLSPAN_DATA' => $row_set->{type} eq 'colspan_data',
308 'NUM_COLUMNS' => scalar @visible_columns,
309 'BORDER_TOP' => $next_border_top,
310 'data' => $row_set->{data},
313 push @rows, $row_data;
315 $next_border_top = 0;
322 foreach my $row (@{ $row_set }) {
325 my $output_columns = [ ];
327 foreach my $col_name (@visible_columns) {
333 my $col = $row->{$col_name};
334 $col->{CELL_ROWS} = [ ];
335 foreach my $i (0 .. scalar(@{ $col->{data} }) - 1) {
336 push @{ $col->{CELL_ROWS} }, {
337 'data' => $self->html_format($col->{data}->[$i]),
338 'link' => $col->{link}->[$i],
342 # Force at least a to be displayed so that browsers
343 # will format the table cell (e.g. borders etc).
344 if (!scalar @{ $col->{CELL_ROWS} }) {
345 push @{ $col->{CELL_ROWS} }, { 'data' => ' ' };
346 } elsif ((1 == scalar @{ $col->{CELL_ROWS} }) && (!defined $col->{CELL_ROWS}->[0]->{data} || ($col->{CELL_ROWS}->[0]->{data} eq ''))) {
347 $col->{CELL_ROWS}->[0]->{data} = ' ';
350 push @{ $output_columns }, $col;
351 $skip_next = $col->{colspan} ? $col->{colspan} - 1 : 0;
355 'COLUMNS' => $output_columns,
356 'outer_idx' => $outer_idx,
357 'outer_idx_odd' => $outer_idx % 2,
358 'inner_idx' => $inner_idx,
359 'BORDER_TOP' => $next_border_top,
362 push @rows, $row_data;
364 $next_border_top = 0;
368 my @export_variables = $self->{form}->flatten_variables(@{ $self->{export}->{variable_list} });
370 my $allow_pdf_export = $opts->{allow_pdf_export};
372 eval { require PDF::API2; require PDF::Table; };
373 $allow_pdf_export |= 1 if (! $@);
376 'TITLE' => $opts->{title},
377 'TOP_INFO_TEXT' => $self->html_format($opts->{top_info_text}),
378 'RAW_TOP_INFO_TEXT' => $opts->{raw_top_info_text},
379 'BOTTOM_INFO_TEXT' => $self->html_format($opts->{bottom_info_text}),
380 'RAW_BOTTOM_INFO_TEXT' => $opts->{raw_bottom_info_text},
381 'ALLOW_PDF_EXPORT' => $allow_pdf_export,
382 'ALLOW_CSV_EXPORT' => $opts->{allow_csv_export},
383 'SHOW_EXPORT_BUTTONS' => ($allow_pdf_export || $opts->{allow_csv_export}) && $self->{data_present},
384 'HEADER_ROWS' => $header_rows,
385 'NUM_COLUMNS' => scalar @column_headers,
387 'EXPORT_VARIABLES' => \@export_variables,
388 'EXPORT_VARIABLE_LIST' => join(' ', @{ $self->{export}->{variable_list} }),
389 'EXPORT_NEXTSUB' => $self->{export}->{nextsub},
390 'DATA_PRESENT' => $self->{data_present},
396 sub generate_html_content {
398 my $variables = $self->prepare_html_content();
400 return $self->{form}->parse_html_template($self->{options}->{html_template}, $variables);
406 return $_[0] * 72 / 2.54;
409 sub generate_pdf_content {
416 my $variables = $self->prepare_html_content();
417 my $form = $self->{form};
418 my $myconfig = $self->{myconfig};
420 my $opts = $self->{options};
421 my $pdfopts = $opts->{pdf_export};
423 my (@data, @column_props, @cell_props);
425 my ($data_row, $cell_props_row);
426 my @visible_columns = $self->get_visible_columns('HTML');
427 my $num_columns = scalar @visible_columns;
428 my $num_header_rows = 1;
430 foreach $name (@visible_columns) {
431 push @column_props, { 'justify' => $self->{columns}->{$name}->{align} eq 'right' ? 'right' : 'left' };
434 if (!$self->{custom_headers}) {
436 $cell_props_row = [];
437 push @data, $data_row;
438 push @cell_props, $cell_props_row;
440 foreach $name (@visible_columns) {
441 $column = $self->{columns}->{$name};
443 push @{ $data_row }, $column->{text};
444 push @{ $cell_props_row }, {};
448 $num_header_rows = scalar @{ $self->{custom_headers} };
450 foreach my $custom_header_row (@{ $self->{custom_headers} }) {
452 $cell_props_row = [];
453 push @data, $data_row;
454 push @cell_props, $cell_props_row;
456 foreach my $custom_header_col (@{ $custom_header_row }) {
457 push @{ $data_row }, $custom_header_col->{text};
459 my $num_output = ($custom_header_col->{colspan} * 1 > 1) ? $custom_header_col->{colspan} : 1;
460 if ($num_output > 1) {
461 push @{ $data_row }, ('') x ($num_output - 1);
462 push @{ $cell_props_row }, { 'colspan' => $num_output };
463 push @{ $cell_props_row }, ({ }) x ($num_output - 1);
466 push @{ $cell_props_row }, {};
472 foreach my $row_set (@{ $self->{data} }) {
473 if ('HASH' eq ref $row_set) {
474 if ($row_set->{type} eq 'colspan_data') {
475 push @data, [ $row_set->{data} ];
477 $cell_props_row = [];
478 push @cell_props, $cell_props_row;
480 foreach (0 .. $num_columns - 1) {
481 push @{ $cell_props_row }, { 'background_color' => '#666666',
482 'font_color' => '#ffffff',
483 'colspan' => $_ == 0 ? -1 : undef, };
489 foreach my $row (@{ $row_set }) {
491 $cell_props_row = [];
493 push @data, $data_row;
494 push @cell_props, $cell_props_row;
497 foreach my $col_name (@visible_columns) {
498 my $col = $row->{$col_name};
499 push @{ $data_row }, join("\n", @{ $col->{data} });
501 $column_props[$col_idx]->{justify} = 'right' if ($col->{align} eq 'right');
503 my $cell_props = { };
504 push @{ $cell_props_row }, $cell_props;
506 if ($col->{colspan} && $col->{colspan} > 1) {
507 $cell_props->{colspan} = $col->{colspan};
515 foreach my $i (0 .. scalar(@data) - 1) {
516 my $aref = $data[$i];
517 my $num_columns_here = scalar @{ $aref };
519 if ($num_columns_here < $num_columns) {
520 push @{ $aref }, ('') x ($num_columns - $num_columns_here);
521 } elsif ($num_columns_here > $num_columns) {
522 splice @{ $aref }, $num_columns;
527 'a3' => [ 842, 1190 ],
528 'a4' => [ 595, 842 ],
529 'a5' => [ 420, 595 ],
530 'letter' => [ 612, 792 ],
531 'legal' => [ 612, 1008 ],
534 my %supported_fonts = map { $_ => 1 } qw(courier georgia helvetica times verdana);
536 my $paper_size = defined $pdfopts->{paper_size} && defined $papersizes->{lc $pdfopts->{paper_size}} ? lc $pdfopts->{paper_size} : 'a4';
537 my ($paper_width, $paper_height);
539 if (lc $pdfopts->{orientation} eq 'landscape') {
540 ($paper_width, $paper_height) = @{$papersizes->{$paper_size}}[1, 0];
542 ($paper_width, $paper_height) = @{$papersizes->{$paper_size}}[0, 1];
545 my $margin_top = _cm2bp($pdfopts->{margin_top} || 1.5);
546 my $margin_bottom = _cm2bp($pdfopts->{margin_bottom} || 1.5);
547 my $margin_left = _cm2bp($pdfopts->{margin_left} || 1.5);
548 my $margin_right = _cm2bp($pdfopts->{margin_right} || 1.5);
550 my $table = PDF::Table->new();
551 my $pdf = PDF::API2->new();
552 my $page = $pdf->page();
554 $pdf->mediabox($paper_width, $paper_height);
556 my $font = $pdf->corefont(defined $pdfopts->{font_name} && $supported_fonts{lc $pdfopts->{font_name}} ? ucfirst $pdfopts->{font_name} : 'Verdana',
557 '-encoding' => $main::dbcharset || 'ISO-8859-15');
558 my $font_size = $pdfopts->{font_size} || 7;
559 my $title_font_size = $font_size + 1;
561 my $font_height = $font_size + 2 * $padding;
562 my $title_font_height = $font_size + 2 * $padding;
564 my $header_height = 2 * $title_font_height if ($opts->{title});
565 my $footer_height = 2 * $font_height if ($pdfopts->{number});
567 my $top_text_height = 0;
569 if ($self->{options}->{top_info_text}) {
570 my $top_text = $self->{options}->{top_info_text};
571 $top_text =~ s/\r//g;
572 $top_text =~ s/\n+$//;
574 my @lines = split m/\n/, $top_text;
575 $top_text_height = $font_height * scalar @lines;
577 foreach my $line_no (0 .. scalar(@lines) - 1) {
578 my $y_pos = $paper_height - $margin_top - $header_height - $line_no * $font_height;
579 my $text_obj = $page->text();
581 $text_obj->font($font, $font_size);
582 $text_obj->translate($margin_left, $y_pos);
583 $text_obj->text($lines[$line_no]);
591 'w' => $paper_width - $margin_left - $margin_right,
592 'start_y' => $paper_height - $margin_top - $header_height - $top_text_height,
593 'next_y' => $paper_height - $margin_top - $header_height,
594 'start_h' => $paper_height - $margin_top - $margin_bottom - $header_height - $footer_height - $top_text_height,
595 'next_h' => $paper_height - $margin_top - $margin_bottom - $header_height - $footer_height,
597 'background_color_odd' => '#ffffff',
598 'background_color_even' => '#eeeeee',
600 'font_size' => $font_size,
601 'font_color' => '#000000',
602 'num_header_rows' => $num_header_rows,
604 'bg_color' => '#ffffff',
606 'font_color' => '#000000',
608 'column_props' => \@column_props,
609 'cell_props' => \@cell_props,
612 foreach my $page_num (1..$pdf->pages()) {
613 my $curpage = $pdf->openpage($page_num);
615 if ($pdfopts->{number}) {
616 my $label = $main::locale->text("Page #1/#2", $page_num, $pdf->pages());
617 my $text_obj = $curpage->text();
619 $text_obj->font($font, $font_size);
620 $text_obj->translate(($paper_width - $margin_left - $margin_right) / 2 + $margin_left - $text_obj->advancewidth($label) / 2, $margin_bottom);
621 $text_obj->text($label);
624 if ($opts->{title}) {
625 my $text_obj = $curpage->text();
627 $text_obj->font($font, $title_font_size);
628 $text_obj->translate(($paper_width - $margin_left - $margin_right) / 2 + $margin_left - $text_obj->advancewidth($opts->{title}) / 2,
629 $paper_height - $margin_top);
630 $text_obj->text($opts->{title}, '-underline' => 1);
634 my $content = $pdf->stringify();
637 if ($pdfopts->{print} && $pdfopts->{printer_id}) {
638 $form->{printer_id} = $pdfopts->{printer_id};
639 $form->get_printer_code($myconfig);
640 $printer_command = $form->{printer_command};
643 if ($printer_command) {
644 $self->_print_content('printer_command' => $printer_command,
645 'content' => $content,
646 'copies' => $pdfopts->{copies});
647 $form->{report_generator_printed} = 1;
650 my $filename = $self->get_attachment_basename();
652 print qq|content-type: application/pdf\n|;
653 print qq|content-disposition: attachment; filename=${filename}.pdf\n\n|;
659 sub verify_paper_size {
661 my $requested_paper_size = lc shift;
662 my $default_paper_size = shift;
664 my %allowed_paper_sizes = map { $_ => 1 } qw(a3 a4 a5 letter legal);
666 return $allowed_paper_sizes{$requested_paper_size} ? $requested_paper_size : $default_paper_size;
673 foreach my $i (1 .. max $params{copies}, 1) {
674 my $printer = IO::File->new("| $params{printer_command}");
675 $main::form->error($main::locale->text('Could not spawn the printer command.')) if (!$printer);
676 $printer->print($params{content});
681 sub unescape_string {
684 my $iconv = $main::locale->{iconv};
686 $text = $main::locale->unquote_special_chars('HTML', $text);
687 $text = $main::locale->{iconv}->convert($text) if ($main::locale->{iconv});
692 sub generate_csv_content {
695 my %valid_sep_chars = (';' => ';', ',' => ',', ':' => ':', 'TAB' => "\t");
696 my %valid_escape_chars = ('"' => 1, "'" => 1);
697 my %valid_quote_chars = ('"' => 1, "'" => 1);
699 my $opts = $self->{options}->{csv_export};
700 my $eol = $opts->{eol_style} eq 'DOS' ? "\r\n" : "\n";
701 my $sep_char = $valid_sep_chars{$opts->{sep_char}} ? $valid_sep_chars{$opts->{sep_char}} : ';';
702 my $escape_char = $valid_escape_chars{$opts->{escape_char}} ? $opts->{escape_char} : '"';
703 my $quote_char = $valid_quote_chars{$opts->{quote_char}} ? $opts->{quote_char} : '"';
705 $escape_char = $quote_char if ($opts->{escape_char} eq 'QUOTE_CHAR');
707 my $csv = Text::CSV_XS->new({ 'binary' => 1,
708 'sep_char' => $sep_char,
709 'escape_char' => $escape_char,
710 'quote_char' => $quote_char,
713 my $stdout = wraphandle(\*STDOUT);
714 my @visible_columns = $self->get_visible_columns('CSV');
716 if ($opts->{headers}) {
717 if (!$self->{custom_headers}) {
718 $csv->print($stdout, [ map { $self->unescape_string($self->{columns}->{$_}->{text}) } @visible_columns ]);
721 foreach my $row (@{ $self->{custom_headers} }) {
724 foreach my $col (@{ $row }) {
725 my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
726 push @{ $fields }, ($self->unescape_string($col->{text})) x $num_output;
729 $csv->print($stdout, $fields);
734 foreach my $row_set (@{ $self->{data} }) {
735 next if ('ARRAY' ne ref $row_set);
736 foreach my $row (@{ $row_set }) {
739 foreach my $col (@visible_columns) {
745 my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
746 $skip_next = $num_output - 1;
748 push @data, join($eol, map { s/\r?\n/$eol/g; $_ } @{ $row->{$col}->{data} });
749 push @data, ('') x $skip_next if ($skip_next);
752 $csv->print($stdout, \@data);
763 SL::ReportGenerator.pm: the Lx-Office way of getting data in shape
767 my $report = SL::ReportGenerator->new(\%myconfig, $form);
768 $report->set_options(%options); # optional
769 $report->set_columns(%column_defs);
770 $report->set_sort_indicator($column, $direction); # optional
771 $report->add_data($row1, $row2, @more_rows);
772 $report->generate_with_headers();
774 This creates a report object, sets a few columns, adds some data and generates a standard report.
775 Sorting of columns will be alphabetic, and options will be set to their defaults.
776 The report will be printed including table headers, html headers and http headers.
780 Imagine the following scenario:
781 There's a simple form, which loads some data from the database, and needs to print it out. You write a template for it.
782 Then there may be more than one line. You add a loop in the template.
783 Then there are some options made by the user, such as hidden columns. You add more to the template.
784 Then it lacks usability. You want it to be able to sort the data. You add code for that.
785 Then there are too many results, you need pagination, you want to print or export that data..... and so on.
787 The ReportGenerator class was designed because this exact scenario happened about half a dozen times in Lx-Office.
788 It's purpose is to manage all those formating, culling, sorting, and templating.
789 Which makes it almost as complicated to use as doing the work for yourself.
795 =item new \%myconfig,$form,%options
797 Creates a new ReportGenerator object, sets all given options, and returns it.
799 =item set_columns %columns
801 Sets the columns available to this report.
803 =item set_column_order @columns
805 Sets the order of columns. Any columns not present here are appended in alphabetic order.
807 =item set_sort_indicator $column,$direction
809 Sets sorting ot the table by specifying a column and a direction, where the direction will be evaluated to ascending if true.
810 Note that this is only for displaying. The data has to be presented already sorted.
812 =item add_data \@data
814 =item add_data \%data
816 Adds data to the report. A given hash_ref is interpreted as a single line of data, every array_ref as a collection of lines.
817 Every line will be expected to be in a kay => value format. Note that the rows have to be already sorted.
818 ReportGenerator does only colum sorting on its own, and provides links to sorting and visual cue as to which column was sorted by.
822 Adds a separator line to the report.
824 =item add_control \%data
826 Adds a control element to the data. Control elements are an experimental feature to add functionality to a report the regular data cannot.
827 Every control element needs to set IS_CONTROL_DATA, in order to be recongnized by the template.
828 Currently the only control element is a colspan element, which can be used as a mini header further down the report.
832 Deletes all data filled into the report, but keeps options set.
834 =item set_options %options
836 Sets options. For an incomplete list of options, see section configuration.
838 =item set_options_from_form
840 Tries to import options from the $form object given at creation
842 =item set_export_options $next_sub,@variable_list
844 Sets next_sub and additional variables needed for export.
846 =item get_attachment_basename
848 Returns the set attachment_basename option, or 'report' if nothing was set. See configuration for the option.
850 =item generate_with_headers
852 Parses the report, adds headers and prints it out. Headers depend on the option 'output_format',
853 for example 'HTML' will add proper table headers, html headers and http headers. See configuration for this option.
855 =item get_visible_columns $format
857 Returns a list of columns that will be visible in the report after considering all options or match the given format.
859 =item html_format $value
861 Escapes HTML characters in $value and substitutes newlines with '<br>'. Returns the escaped $value.
863 =item prepare_html_content $column,$name,@column_headers
865 Parses the data, and sets internal data needed for certain output format. Must be called once before the template is invoked.
866 Should not be called extrenally, since all render and generate functions invoke it anyway.
868 =item generate_html_content
870 The html generation function. Is invoked by generate_with_headers.
872 =item generate_pdf_content
874 The PDF generation function. It is invoked by generate_with_headers, tests whether or not the Perl module PDF::API2 is installed and calls render_pdf_with_pdf_api2 if it is and render_pdf_with_html2ps otherwise.
876 =item generate_csv_content
878 The CSV generation function. Uses XS_CSV to parse the information into csv.
880 =item render_pdf_with_pdf_api2
882 PDF render function using the Perl module PDF::API2.
884 =item render_pdf_with_html2ps
886 PDF render function using the external application html2ps.
892 These are known options and their defaults. Options for pdf export and csv export need to be set as a hashref inside the export option.
894 =head2 General Options
898 =item std_column_visibility
900 Standard column visibility. Used if no visibility is set. Use this to save the trouble of enabling every column. Default is no.
904 Output format. Used by generate_with_headers to determine the format. Supported options are HTML, CSV, and PDF. Default is HTML.
906 =item allow_pdf_export
908 Used to determine if a button for PDF export should be displayed. Default is yes. The PDF button is hidden if neither the Perl module PDF::API2 nor the external applications html2ps and Ghostscript are available regardless of this parameter's value.
910 =item allow_csv_export
912 Used to determine if a button for CSV export should be displayed. Default is yes.
916 The template to be used for HTML reports. Default is 'report_generator/html_report'.
926 Paper size. Default is a4. Supported paper sizes are a3, a4, a5, letter and legal.
928 =item orientation (landscape)
930 Landscape or portrait. Default is landscape.
934 Default is Verdana. Supported font names are Courier, Georgia, Helvetica, Times and Verdana. This option only affects the rendering with PDF::API2.
938 Default is 7. This option only affects the rendering with PDF::API2.
948 The paper margins in cm. They all default to 1.5.
952 Set to a true value if the pages should be numbered. Default is 1.
956 If set then the resulting PDF will be output to a printer. If not it will be downloaded by the user. Default is no.
974 Character to enclose entries. Default is double quote (").
978 Character to separate entries. Default is semicolon (;).
982 Character to escape the quote_char. Default is double quote (").
986 End of line style. Default is Unix.
990 Include headers? Default is yes.
998 =head1 MODULE AUTHORS
1000 Moritz Bunkus E<lt>mbunkus@linet-services.deE<gt>
1002 L<http://linet-services.de>