Lines 797-802
elsif ($phase eq 'Export'){
Link Here
|
797 |
# export results to tab separated text or CSV |
797 |
# export results to tab separated text or CSV |
798 |
my $sql = $input->param('sql'); # FIXME: use sql from saved report ID#, not new user-supplied SQL! |
798 |
my $sql = $input->param('sql'); # FIXME: use sql from saved report ID#, not new user-supplied SQL! |
799 |
my $format = $input->param('format'); |
799 |
my $format = $input->param('format'); |
|
|
800 |
my $reportname = $input->param('reportname'); |
801 |
my $reportfilename = $reportname ? "$reportname-reportresults.$format" : "reportresults.$format" ; |
800 |
my ($sth, $q_errors) = execute_query($sql); |
802 |
my ($sth, $q_errors) = execute_query($sql); |
801 |
unless ($q_errors and @$q_errors) { |
803 |
unless ($q_errors and @$q_errors) { |
802 |
my ( $type, $content ); |
804 |
my ( $type, $content ); |
Lines 870-876
elsif ($phase eq 'Export'){
Link Here
|
870 |
} |
872 |
} |
871 |
print $input->header( |
873 |
print $input->header( |
872 |
-type => $type, |
874 |
-type => $type, |
873 |
-attachment=>"reportresults.$format" |
875 |
-attachment=> $reportfilename |
874 |
); |
876 |
); |
875 |
print $content; |
877 |
print $content; |
876 |
|
878 |
|
877 |
- |
|
|