I have built several dashboards and working great - great product. One of the dashboards I want to export to Excel after a Select widget and click on Button widget. I'm using exact code to export from a Laravel app where export works (direct to file w/o view). Code processes but no export. Does Excel export work within a dashboard?
protected function actionSubmit($request, $response)
{
include "snapShot.php";
$report = new snapShot;
$report->run();
$report->exportToExcel()->toBrowser("snapshot.xlsx");
}
snapshot.php <?php
class snapShot extends \koolreport\KoolReport
{
use \koolreport\export\Exportable;
use \koolreport\excel\ExcelExportable;
public function settings()
{
return array(
"dataSources"=>array(
"snapShot"=>array(
"connectionString"=>"sqlsrv:server=xxxxxxxxxxxxxxxxxxxxxxxxxx",
"username"=>"xxxxxxxxxxxxxx",
"password"=>"xxxxxxxxxxxxxxxxx",
"charset"=>"utf8"
)
)
);
}
public function setup()
{
$this->src('snapShot')
->query("SELECT *
FROM [dbo].[snapshot2019]
")
->pipe($this->dataStore('snap_shot'));
}
}