I want to export xlsx files using js-xlsx on my Node.JS server. I can read files and save them. But as i try to fill the Table with content it does not work.
I fill it using lines like these:
for (var i = 0; i < workbook.SheetNames.length; i++) {
var sheet = workbook.Sheets[workbook.SheetNames[i]];
var studenten = stapel[workbook.SheetNames[i]];
sheet["A1"] = {v: "This is a test!",t:"s"};
workbook.Sheets[workbook.SheetNames[i]] = sheet;
}
, I tried using this notation for the cell address too
{c:0,r:0}
but as i export my file the tables are empty. Creating different worksheets works fine but i can't fill the tables with content. Could someone here enlighten me on how to correctly address the tables and manipulate their content?
Thanks in advance!
update: even
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
var workbook = new Workbook();
workbook.SheetNames.push("1");
workbook.Sheets[1] = {'A1': {v: "HI",t:"s"}};
doesn't work. I think I don't understand the API!