KoolReport's Forum

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

Export as Excel #348

Open V Vijaykumarr opened this topic on on Jul 4, 2018 - 2 comments

V Vijaykumarr commented on Jul 4, 2018

Hello,

I am using this php report example as a reference.

What is the export code for the above report.

Please guide to export the loaded result as excel.

I am using the below code

require_once "OrderList.php";
$report = new OrderList;
$report->run()->exportToExcel()->toBrowser("Property Listings.xls");

But exported report shows,

<b>Warning</b>:  array_keys() expects parameter 1 to be array, null given in <b>C:\xampp\htdocs\reports\koolreport\packages\excel\ExcelExportable.php</b> on line <b>37</b><br />

Thanks.

KoolReport commented on Jul 5, 2018

May be you should follow this pdf export example and replace the PDF export to Excel export.

David Winterburn commented on Jul 6, 2018

Hi Vijay,

It seems there's some datastore in your report that has no data which caused the null error when we called array_keys function. Please specify the exact datastore you want to export like this:

->exportToExcel(array('myDatastore'))
->toBrowser("Property Listings.xls");

Please try this and let us know if there's still problem. Thanks!

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

Inputs