aoa_to_sheet may produce <c r="A1"><v>NaN</v> #2897
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#2897
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
I used ParseInt to fillout a specific column of my aoa (Array of Array) and after using
for NaN values the sheet1.xml file showed NaN
this makes excel prompt out the following alert at file opening:
with the following not-so-much-usefull recovery log:
I fixed my code and I'm not providing NaN values anymore to my aoa but others may encounter the same issue and loose time to understand why suddenly the exported .xlsx file is corrupted. It would be super cool if aoa_to_sheet would convert NaN to acceptable excel info.
The error logs definitely leave much to be desired.
In our Pro builds , the NaN guard is in the export codecs. It was decided that the best approach was to show an error in the console and skip NaN values. We will port that over.
Additionally, it probably makes sense to do something sensible in
aoa_to_sheet
andjson_to_sheet
. The options are:A) skip cells, optionally with a warning
B) throw an error
C) translate to an error cell like
#DIV/0!
or#VALUE!
It's hard to say what is the right option. The error cell mimics the result if you type values in Excel, but it might be surprising for users who didn't know they were exporting NaN values.