@@ -, +, @@ --------- https://.../cgi-bin/koha/svc/report?id=## https://.../cgi-bin/koha/svc/report?id=##&header=1 NOTE: There are two patches, but you could just test 1. --- opac/svc/report | 5 +++++ 1 file changed, 5 insertions(+) --- a/opac/svc/report +++ a/opac/svc/report @@ -30,6 +30,7 @@ use Koha::Cache; my $query = CGI->new(); my $report_id = $query->param('id'); my $report_name = $query->param('name'); +my $report_header = $query->param('header'); my $report_rec = get_saved_report( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } ); die "Sorry this report is not public\n" unless $report_rec->{public}; @@ -48,7 +49,11 @@ unless ($json_text) { my $limit = C4::Context->preference("SvcMaxReportRows") || 10; my ( $sth, $errors ) = execute_query( $report_rec->{savedsql}, $offset, $limit ); if ($sth) { + my $header = $sth->{NAME}; my $lines = $sth->fetchall_arrayref; + if ($report_header) { + unshift @{$lines}, [ @{$header} ]; + } $json_text = to_json($lines); if ($cache_active) { --