All solutions above use one of two methodes:
- Use COM Automation to run an instance of Excel, to create an Excel file.
- Create a HTML file with an ".xls" file extension.
The problem with the first solution is that you must have Excel installed on the server. Apart from stability problems you may get from running and quitting a headless instance of Excel for every Excel file that needs to be produced, you may also breaking the license agreement because you basically put every user of your webpage "in control" of Excel.
The second method is the one I am also commonly using. It works pretty well, except when people want to re-save the Excel file (in which case it will write a HTML file instead of an Excel file by default), or when people want to open the file in another application (neither OpenOffice.org Calc, nor Google Docs Spreadsheet recognize this "fake" Excel file).
I know however of several other methods, for which you will find very little documentation on internet, and I do not have much experience with them myself either.
- Run a "headless" instance of OpenOffice.org on the server to create XLS files (can also be used to generate or convert PDF and ODT files, but has many of the same stability problems as running Excel on the server).
- Create Excel 2007 XMLX files (also know as Open Office XML, OOXML or SpreadsheetML files, NOT TO BE CONFUSED with OpenOffice.org XML files), which are basically just zipped XML files, but which require the user has Excel 2007 or the Office Compatibility Pack for Office 2007 File Formats installed.
- Use NPOI to create Excel 2003 XML files (http://npoi.codeplex.com/).
- Use ADOX to create Excel files: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=52806