excel export (wip)

This commit is contained in:
Dobromir Popov
2024-09-16 21:28:26 +03:00
parent ed3222a428
commit c9dbe48050
5 changed files with 147 additions and 8 deletions

View File

@ -14,6 +14,10 @@ const data = require("./data");
// for nodejs
//const api = require("./pages/api/index");
// import dynamic from 'next/dynamic';
// const XLSX = dynamic(() => import('xlsx-style'), { ssr: false });
exports.ScheduleGenerateExcel = async function (req, res) {
@ -162,7 +166,7 @@ exports.ScheduleGenerateExcel = async function (req, res) {
const ws = XLSX.utils.aoa_to_sheet(ws_data);
wb.Sheets["График КОЛИЧКИ"] = ws;
const xlsxstyle = require("xlsx-style");
const xlsxstyle = require("xlsx-js-style");
try {
const workbook = xlsxstyle.readFile(filePath);
const sheetNames = workbook.SheetNames;