xlsx.read cellStyles: true not working
Opened this issue · 3 comments
huan415201 commented
I read a template file with styles but using cellStyles: true
is not working, below is my code:
const exportReportCardExcel = async (data) => {
const binaryString = await readFile(ExportReportCardTemplate);
const workbook = xlsx.read(binaryString, {
type: "binary",
cellStyles: true,
});
xlsx.writeFile(workbook, `file_xxx.xlsx`);
}
const readFile = (file) => {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = (e) => {
resolve(e.target.result);
};
reader.onerror = (e) => {
reject(e);
};
fetch(file)
.then((response) => response.blob())
.then((file) => reader.readAsBinaryString(file));
});
};
Here is the template:
And here is the new exported file:
ZhenjaMax commented
@huan415201 I have the same problem... did you solve your problem?
jorisvo2 commented
@huan415201 Any news about this issue ?
snowepiphany commented
any updates about this issue?