Output to Excel as .xls (not .xlsx or .csv)
Output to Excel as .xls (not .xlsx or .csv)
raw10
Posts: 2Questions: 0Answers: 0
Hi Allan,
I've been playing around with exporting to Excel, and TableTools + DataTables works well for exporting to .csv files. The issue as you know is exporting to a formatted Excel file, and I've read a number of discussions here and elsewhere about the idea and problems of generating .xls and .xlsx from the browser.
Have you considered simply exporting the table as an HTML document with the .xls extension? Excel will accept it gracefully and attempt to preserve formatting, formulas, merged cells, and so on. It's not as elegant as writing the native XML and zipping it up into .xlsx directly, but I think it might be a simple workaround that's better than the current .csv-only solution.
I've been playing around with exporting to Excel, and TableTools + DataTables works well for exporting to .csv files. The issue as you know is exporting to a formatted Excel file, and I've read a number of discussions here and elsewhere about the idea and problems of generating .xls and .xlsx from the browser.
Have you considered simply exporting the table as an HTML document with the .xls extension? Excel will accept it gracefully and attempt to preserve formatting, formulas, merged cells, and so on. It's not as elegant as writing the native XML and zipping it up into .xlsx directly, but I think it might be a simple workaround that's better than the current .csv-only solution.
This discussion has been closed.
Replies
I've opened an issue for TableTools to cover this: https://github.com/DataTables/TableTools/issues/25 . I'm not sure when I'll get a chance to do it as all of my available effort is currently being put into v1.10 (and the forum of course :-) ), but it sounds like a good idea. Thanks for suggesting it!
Allan
I just found this: http://stackoverflow.com/questions/14125819/export-html-table-to-excel-but-select-a-name-for-the-file
Would this be a viable solution?
Allan