You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exceljs 1.1.0
AddRow and addRows by array don’t work.
I’ve copied your examples, but only addRow by key-value works. The xlsx-result file shows only row "6; Barbara;.." . Previous rows added by arrays are empty. Here is the simple code:
`var Excel = require('exceljs');
var workbook = new Excel.Workbook();
var worksheet = workbook.addWorksheet('ExampleWS');
// Add a row by sparse Array (assign to columns A, E & I)
var rowValues = [];
rowValues[1] = 4;
rowValues[5] = 'Kyle';
rowValues[9] = new Date();
worksheet.addRow(rowValues);
var rows = [
[5,'Bob',new Date()], // row by array
{id:6, name: 'Barbara', dob: new Date()}
];
worksheet.addRows(rows);
//write in File
var strFilename = "testExceljs01.xlsx";
workbook.xlsx.writeFile(strFilename)
.then(function() {
console.log("file OK");
});
`
I am probably kind of late.
The function addRow supplying an array of values such as in
addRow['1', '2', '3']
does NOT work for me executing it on a Rasperry PI, LINUX, computer from within th ioBroker (a home automation system) using a script developed in JS with the ioBroker javascript adapter. The row is added, but there are no data.
DOES work for me executing it in Visual Studio Code, on the same computer, i.e. Rasperry PI , LINUX.
exceljs 1.1.0
AddRow and addRows by array don’t work.
I’ve copied your examples, but only addRow by key-value works. The xlsx-result file shows only row "6; Barbara;.." . Previous rows added by arrays are empty. Here is the simple code:
`var Excel = require('exceljs');
var workbook = new Excel.Workbook();
var worksheet = workbook.addWorksheet('ExampleWS');
worksheet.columns = [
{ header: 'Id', key: 'id', width: 10 },
{ header: 'Name', key: 'name', width: 32 },
{ header: 'D.O.B.', key: 'dob', width: 10 }
];
// Add a row by sparse Array (assign to columns A, E & I)
var rowValues = [];
rowValues[1] = 4;
rowValues[5] = 'Kyle';
rowValues[9] = new Date();
worksheet.addRow(rowValues);
var rows = [
[5,'Bob',new Date()], // row by array
{id:6, name: 'Barbara', dob: new Date()}
];
worksheet.addRows(rows);
//write in File
var strFilename = "testExceljs01.xlsx";
workbook.xlsx.writeFile(strFilename)
.then(function() {
console.log("file OK");
});
`
And here is the xlsx-result file:
Uploading testExceljs01.xlsx…
The text was updated successfully, but these errors were encountered: