I've been looking for a good Excel file generation class and have yet to find one - my number one issue is that I although I can get the exported file to open in Excel (running 2007), I always get a warning saying "the file is in a different format to the file extension".
I noticed that the Excel export in phpMyAdmin even generates the aforementioned warning message.
What code do other users use for this common requirement?
Quick update If I set the file extension of my generated Excel file as xml it opens in the browser (even though I'm sending the correct headers), but if I choose to save the xml file and then open it from Excel, it works without any warnings! Unfortunately, that's more hassle for the users than simply clicking 'Proceed anyway' with the warning I'm getting. Any more ideas?
You also disable the dialogbox, using regedit
I've discovered that adding the following, under the xml declaration in my generated Excel file, ensures Excel opens the file with an xml file extension (rather than the web browser):
I'm also setting the following headers in php:
http://www.phpexcel.net
Have you tried saving the file with another file extension? Like "foo.xlsx" instead of "foo.xls".
Use Spreadsheet_Excel_Writer from PEAR
or
Write the file to CSV format.
But use Microsoft Excels understanding of csv: A semicolon(;) as seperator