I'm currently trying to export an array to an excel file with cell formatting.
I'm starting off with this code here:
https://github.com/SheetJS/js-xlsx/blob/master/tests/write.js
But the problem is that whenever I'm trying to export it (save the file as an xlsx file) this is the error that shows up in the console:
Uncaught TypeError: Cannot read property 'writeFileSync' of undefined xlsx.js:5182
writeSync xlsx.js:5182
writeFileSync xlsx.js:5173
process_xlsx Test.html:379
reader.onload Test.html:438
The last 2 lines are basically the part of the code which says
XLSX.writeFile(wb, 'sheetjs.xlsx');
I know wb is not undefined as if I try and do console.log of it, the excel spreadsheet shows up properly :|
Can someone help me with this? I'm also trying to have each cell have a different formatting (IE different color/bolded/filled/etc)