I am trying to export datatable to excel in javascript. I am using d3.js , dc.js and crossfilter.js . My code is based off of this example.
FileSaver.js is used to export Datatable.
I want to export my datatable to excel (instead of CSV). How do I do that?
d3.select('#btnExport')
.on('click', function() {
var data = newTableDim.top(Infinity);
var blob = new Blob([d3.csv.format(data)], {type: "text/csv;charset=utf-8"});
saveAs(blob, 'data.csv');
});
How do I change it to save results to excel ? Any Pointers?
Ref: Export Data from dc.js dataTable into CSV
EDIT: I get this Excel Warning, after I save it as xls.
I guess I can keep it as .csv.