KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Exported CSV contains javascript at the end of the exported entries. #2972

Open Tony Hartmann opened this topic on on Feb 3, 2023 - 2 comments

Tony Hartmann commented on Feb 3, 2023

Hello Guys,

this is a bug report for the koolreport export functionality.

System: Laravel with Debugbar turned on.

$report = new UndeliveredPackagesReport();
        $report->run();
        $report->exportToCSV()->toBrowser('my_test.txt');

What happened: The Koolreport Export fired and exported all entries BUT at the end of the exported file it also attached javascript of debugbar.

What I expected: Only the entries, nothing else.

Would be great if this can be fixed.

KoolReport commented on Feb 6, 2023

Hi Tony,

Thank you very much for letting us know, the KoolReport Export will only output the CSV file content without any javascript. The javascript added is from the debugbar trying to put into the csv output. It seems that we are not able to control this.

The possible way is you turn off the debugbar before run exporting code.

Hope that helps.

Sebastian Morales commented on Feb 7, 2023

Regarding excessive content after a report export, you can put an exit command after method ->toBrowser() or ->saveAs() like this and see if it helps:

        $report->run();
        $report->exportToCSV()->toBrowser('my_test.txt');
        exit;

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Export