Replies: 1 comment
-
You can create a workbook, add a worksheet, then use the const Excel = require("exceljs");
const workbook = new Excel.Workbook();
const worksheet = workbook.addWorksheet("Sheet1");
worksheet.columns = [
{ header: "ID", key: "id", width: 30 },
{ header: "Name", key: "name", width: 50 },
];
// insert from the second row onwards
worksheet.insertRows(2, [{ id: 1, name: "John Doe" }, { id: 2, name: "Jane Doe" }]);
// ... do whatever you want with the worksheet/workbook |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just found this library and reading through the doc which is very very very long and kind of disorienting i would like to know if it is possible and if so how tedious the process can be with this library to pass an array of objects in JSON and export it as an excel file.
Giving as each column header the key for each key value pair, and having the values inserted to each row.
Thank you in advance.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions