Hi guys,
I am trying to export an excel sheet. I have the following headers:
$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: filename=".$filename.".xls");
This works fine but if you open in excel 2007 + you get a popup/warning ("the file you are trying to open 'filename.xls' , is in a different format than specified by the file extension..") which lets you open it but I would like to remove this message if possible
I came across this content-type for 2007+
header("Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
but this won't even open at all...
I get the following message: "Excel cannot open the file 'filename.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted..."
i came across a few searches that said this had to be done on the client end and then some others which recommend maybe using a class like phpExcel. I don't know if i have all the access i need to implement this class though so was wondering if anyone had any suggestions or is this something i am gonna have to investigate?
thanks