admin管理员组文章数量:1348142
How to create/ add a new sheet file in an already existing xlsx file using the xlsx package by sheetjs in Node js?
This is my code by far, for an existing "todo-list.xlsx" file.
const xlsx = require('xlsx');
workBook = xlsx.readFile("todo-list.xlsx", {cellDates:true});
I would like to do something like this (this is done by using the Excel JS package):
const sheet = workbookStream.addSheet('sheet1');
... but using the xlsx package.
Thank you very much in advanced!
How to create/ add a new sheet file in an already existing xlsx file using the xlsx package by sheetjs in Node js?
This is my code by far, for an existing "todo-list.xlsx" file.
const xlsx = require('xlsx');
workBook = xlsx.readFile("todo-list.xlsx", {cellDates:true});
I would like to do something like this (this is done by using the Excel JS package):
const sheet = workbookStream.addSheet('sheet1');
... but using the xlsx package.
Thank you very much in advanced!
Share Improve this question edited Dec 14, 2020 at 14:56 Oliver asked Dec 14, 2020 at 14:30 OliverOliver 5922 gold badges13 silver badges29 bronze badges1 Answer
Reset to default 8There is an example of adding a new worksheet to an existing workbook In the official documentation:
var ws_name = "SheetJS";
/* make worksheet */
var ws_data = [
[ "S", "h", "e", "e", "t", "J", "S" ],
[ 1 , 2 , 3 , 4 , 5 ]
];
var ws = XLSX.utils.aoa_to_sheet(ws_data);
/* Add the worksheet to the workbook */
XLSX.utils.book_append_sheet(wb, ws, ws_name);
See Working with the Workbook
本文标签:
版权声明:本文标题:javascript - How to create a new sheet in an existing xlsx file using xlsxsheetjs package in node js? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743844597a2548885.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论