I am generating an HTML table full of data. They need it to be an editable spreadsheet though that they can save and edit.
I currently have it exactly as they want but as an HTML table, is there anyway I can convert this to an excel spread sheet that they can download?
Thanks!!
Here's what I use, hasn't failed me yet:
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header ("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encoding: none');
header('Content-Type: application/vnd.ms-excel;'); // This should work for IE & Opera
header("Content-type: application/x-msexcel"); // This should work for the rest
header('Content-Disposition: attachment; filename="'.basename('yourFilenameHere.xls').'"');
'yourFilenameHere.xls' should obviously be changed :)
You could use Spreadsheet_Excel_Writer PEAR package to achive a downloadable file as output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With