Closed FabienLucini closed 6 years ago
https://github.com/yajra/laravel-datatables-buttons/blob/cdf7df773461900791491b1855397b099230b1f8/src/Transformers/DataArrayTransformer.php#L42
Hi, it seems that you are always returning strings here, but if we want an excel sheet to be correctly formatted with numbers for example, we should return the original variable type.
You could do this for example :
if ($type == 'exportable') { $dataType = gettype($data); $data = $this->decodeContent($data); settype($data, $dataType); $title = $this->decodeContent($title); }
@FabienLucini sorry for late response, can you submit a PR on your proposed solution? Thanks!
https://github.com/yajra/laravel-datatables-buttons/blob/cdf7df773461900791491b1855397b099230b1f8/src/Transformers/DataArrayTransformer.php#L42
Hi, it seems that you are always returning strings here, but if we want an excel sheet to be correctly formatted with numbers for example, we should return the original variable type.
You could do this for example :