sub generate_with_headers {
my $self = shift;
my $format = lc $self->{options}->{output_format};
+ my $form = $self->{form};
if (!$self->{columns}) {
- $self->{form}->error('Incorrect usage -- no columns specified');
+ $form->error('Incorrect usage -- no columns specified');
}
my $filename = $self->{options}->{attachment_basename} || 'report';
$filename =~ s|.*/||;
if ($format eq 'html') {
- $self->{form}->{title} = $self->{title};
- $self->{form}->header();
+ my $title = $form->{title};
+ $form->{title} = $self->{title} if ($self->{title});
+ $form->header();
+ $form->{title} = $title;
+
print $self->generate_html_content();
} elsif ($format eq 'csv') {
$self->generate_pdf_content();
} else {
- $self->{form}->error('Incorrect usage -- unknown format (supported are HTML, CSV, PDF)');
+ $form->error('Incorrect usage -- unknown format (supported are HTML, CSV, PDF)');
}
}