I am trying to generate an Excel file with CodeIgniter and the PhpSpreadsheet library from a view. The report that I need to do is not a list but much more complex and I can generate them more quickly with a view and sending parameters. This is my code:
$data = $this->model->traedatos();
$vista = $this->load->view("datos_view", $data);
$spreadsheet = new Spreadsheet();
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
$writer->save($vista);
And the following error is displayed
Severity: Warning
Message: fopen (): Filename can not be empty
Filename: Writer / Html.php
Line Number: 160
The PhpSpreadsheet documentation shows that an html page must be explicitly sent:
$writer->save("05featuredemo.htm");
Is there any way to do what I need?
Thanks for the help