26
rated 0 times
[
27]
[
1]
/ answers: 1 / hits: 7950
/ 4 Years ago, thu, june 11, 2020, 12:00:00
I would like to know if it is possible to create an Excel File and make it downloaded from a web page with javascript ?
Currentlly, I succes to create a .csv and make it downloaded with the following code :
var blob = new Blob([csvText], { type: 'text/csv;charset=UFT-8;' });
var link = document.createElement(a);
if (link.download !== undefined) { // feature detection
// Browsers that support HTML5 download attribute
var url = URL.createObjectURL(blob);
link.setAttribute(href, url);
link.setAttribute(download, file.csv);
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
I am wondering if there is any librairies in javascript with permit to convert the file from csv format to xlsx format and make it downloaded the same way than the csv ?
The final aim is to set a template in the downlaoded xlsx.
More From » excel