Datatables - implementation - export data to Excel using libraries XLSX and FileSaver
Datatables - implementation - export data to Excel using libraries XLSX and FileSaver
Hey guys,
I've just implemented the data export to Excel.
TableTools already provides an export to XLS. My problem was that I wanted to export data to Excel then import it to the table. The problem is that the file didn't had a 'ContentType'.
Here is my solution:
http://jsfiddle.net/fiddle_gabriela/ux4yr7zf/
I've modified the js file TableTools.js, I've added methods sheetFromArrayOfArrays() and s2ab() - they are used by XLSX library.
The changes that I made to export to excel are in TableTools.BUTTONS, "xls"
You must replace TableTools.js with the file in jsfiddle and import FileSaver and js-xlsx into index.html
Cheers!