View | Details | Raw Unified | Return to bug 14013
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (+1 lines)
Lines 841-846 canned reports and writing custom SQL reports.</p> Link Here
841
<input type="hidden" name="sql" value="[% sql |html %]" />
841
<input type="hidden" name="sql" value="[% sql |html %]" />
842
<input type="hidden" name="phase" value="Export" />
842
<input type="hidden" name="phase" value="Export" />
843
<input type="submit" name="submit" value="Download" /></fieldset>
843
<input type="submit" name="submit" value="Download" /></fieldset>
844
<input type="hidden" name="reportname" value="[% name %]" />
844
</form>
845
</form>
845
[% END %]
846
[% END %]
846
[% END %]
847
[% END %]
(-)a/reports/guided_reports.pl (-2 / +3 lines)
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
- 

Return to bug 14013