Export setting
In normal export command you could set export option like "dataStores" or setting like "useLocalTempFolder" together in the first parameter.
$optionAndSetting = [
"dataStores" => ...,
"useLocalTempFolder" => true,
];
$report->run()
->exportToExcel($optionAndSetting)
// ->exportToCSV($optionAndSetting)
->toBrowser("myreport.xlsx");
With template export you could set export setting using the second parameter.
$setting = [
"useLocalTempFolder" => true,
];
$report->run()
->exportToExcel($template, $setting)
// ->exportToXLSX($template, $setting)
// ->exportToODS($template, $setting)
->toBrowser("myreport.xlsx");
useLocalTempFolder #
By default export uses system temporary directory to save temp files. If you set "useLocalTempFolder" = true, a "tmp" directory in the current report direction would be created and used instead. Since version 10.0.0, you could set "useLocalTempFolder" to be a path to any directory to be used as a temporary one.
$setting = [
"useLocalTempFolder" => "../../temp", // a relative or an absolute path
];
$report->run()
->exportToExcel($template, $setting)
...
autoDeleteTempFile (version >= 10.0.0) #
Be default export temporary files are generated and kept in temporary directory. You could choose to delete them after export finishes with "autoDeleteTempFile" = true.
$setting = [
"useLocalTempFolder" => "../../temp",
"autoDeleteTempFile" => true
];
$report->run()
->exportToExcel($template, $setting)
...
Get started with KoolReport
KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.