Good morning
I would like you to help me export the data array to excel because when exporting I get the following message: "Call to a member function meta() on array" . From a mysql query I get the data and build an array, the code is the following:
arrayFinished=[];
$date="2019-07-24";
foreach ($dataQuery as $data) {
$idcustomer = $data->idcustomer;
$name= $data->name;
$arrayDet = array("IDCUSTOMER" => $idcustomer, "CUSTOMER" => $name);
$valor=0;
foreach ($dataQuery2 as $data2) {
if ($data2->idcustomer == $idcustomer) {
$valor = $data2->value;
}
}
$arrDet[$date] = floatval($valor);
array_push(arrayFinished, $arrayDet);
}
$arrayColumnsExcel=["IDCUSTOMER","CUSTOMER","2019-07-24"]
$this->dataStore('arrayFinished')->data($arrayFinished);
$this->dataStore('arrayColumnsExcel')->data($arrayColumnsExcel);
To export to Excel I do the following:
\koolreport\excel\Table::create(array(
"dataSource" => $this->dataStore("arrayFinished"),
"columns"=>$this->dataStore("arrayColumnsExcel")->data()
));
Regards