Replies: 1 comment
-
i, too, have the same problem. it seems by loading the file like this:
and saving anything commited to the any cells will not corrupt the file but it will strip all the table properties as it is ignored. this is the only way that i have found. |
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
-
Hi all,
we are using exceljs in a project aimed to produce reports in excel format starting from an empty excel template.
As we started to code, we run into an issue that can be synthesized in the simple following code fragment:
The issue is: if the
template.xlsx
contains an Excel table with headers, the resultingreport.xlsx
file will be corrupted. As soon as we try to open the output file in Excel, a message is displayed telling us that a portion of the file is corrupted. Then Excel try to recover it and actually it succeeds.Diving into the library code, we observed that the
parseOpen()
function in/lib/xlsx/xform/table/table-xform.js
relies on the presence of the table attributeheaderRowCount
in the XML file. We found that the attribute is missing, even if the table in Excel has been defined "with headers". By forcing the attribute presence in theparseOpen()
function, everything works fine.Note also that the original template is loaded without any issue in Excel: Excel correctly identifies the table and its header.
The question is: who is wrong with the
headerRowCount
attribute ? Excel or the library? In other words: is the library expecting the attribute to be in the wrong place? Or maybe it was the right place but it has been moved in one of the last release of Excel?Anyone having the same issue?
Beta Was this translation helpful? Give feedback.
All reactions