I am attempting to implement a cross browser method to allow the download of HTML table data into an excel sheet. I understand this is possible in a few ways:
Do it serverside and have the server respond with a file with the correct mimetype and thus force the browser to ask the user to download the excel sheet. This is not optimal at all, as we have tables with huge amounts of data, and every client will initially display the data in a browser and then download the data and we would liek to avoid multiple requests hammering the server.
Do it clientside using javascript to convert the HTML table to CSV and then use DataURI to download the resulting data. This is a no go either, as we need to support IE8 and 9, which do have some restrictions on data URI's. I have attempted this and can confirm it works in firefox and chrome and IE10 and above for us. My solution was based on this post: Export to CSV using jQuery and html
We are using the pretty amazing datatables library which has the tabletools plugin - this enables clientside downloads using a flash plugin. However this is also a no go, as we have heavily extended the datatables library and use it across multiple products, and the messy setup we have with requirejs, means plugging in the tabletools library has proved to be nigh on impossible (we have to ensure it is a local install for the product we are developing and not include the library across the shared codebase, unfortunately thats where our extended datatables library is, and requirejs isn't playing nice with that setup)
Finally we are able to use downloadify, which is what the tooltable library is based on. This is cross browser and takes a HTML table and lets you download it with a filename of your choice.
This seems like a great choice for us, however I was wondering if anyone knew of any other tools that would acheive the same results, firstly as a failsafe against outdated code (downloadify is 4 years old now) and also to see what else is out there (perhaps better libraries which can differentiate between HTML5 support and use the flash support as a fallback, or those with support for mobile/tablet platforms). It seems strange that in all my searches I have found just the one tool that fits our purpose.