Support XLSX XML sheet files with missing t attributes #2843
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2843
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Our bank exports XLSX files with sheet1.xml files that have HYPERLINK formulas to indicate file attachments. They are missing the t-attribute that specifies the field type:
I propose adding a default case to the t attribute check in
1ca49a50bd/bits/67_wsxml.js (L428)
so that a missing t attribute would be treated as t="str", allowing to import these files.Currently the xlsx module just ignores these fields, resulting in a partial import, and there is no way to access the missing fields.
To ensure the cell is parsed, pass the option
sheetStubs: true
when reading the file.As for type deduction, the official schema in ECMA-376 defines the
t
attribute as follows:It might make sense to speculate on the cell type by using the formula (there are a number of formula functions whose return type is textual or logical), but
sheetStubs
should address the immediate problem.Thanks for the great tip @sheetjs! I tried most of the other read parameters, but didn't realize sheetStubs would help. Now I can see the original formulas in the imported object. I've also notified the bank that their file export is a bit broken.
We'll consider flipping that default in the next release.