define Cell Data Format #2171
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2171
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?
Is there a way to enforce Cell Data Format for empty cells?
I generate the sheet with:
however, after downloading the sheet and opening it in Numbers the Data Format is automatic.
I want to enforce this to be text.
That is probably an issue with Numbers XLSX import codec. To be sure, can you construct something Numbers would accept? To do this:
after reading the documentation, do something to make Numbers treat the default format as Text
save as XLSX and confirm that reopening the file shows that the default format is text
either email the file to us (hello@sheetjs.com) or post it to this issue (you should be able to click-drag XLSX files into the text box in the GH website)
@akoskm did you find a solution for this? I am having the same issue here, both Excel and Numbers softwares consider all cells the 'Automatic' type...
@leodavinci1 I did not find a solution to this. I was able to verify that in Excel you can save sheets with pre-set cell types that on opening keep their types.
same question, mark
Same question, did anyone find a solution in the meanwhile?
Same question...
Samples:
To find the formats, run in NodeJS:
So forcing "Text" seems to be a matter of setting the cell number format to Text (
@
in Excel).This normally would be
However there is a logical bug in the cell filtering. Feel free to submit a PR:
Nice to know I wasn't going crazy.
Workaround: have cell stub with empty string value
v
and cell typet
of text to pass the filter, apply formatting toz
:@SheetJSDev the line you show is already fixed in commit
warn on codepage override in mini build [ci skip]
, but there hasn't been a new release for 4 months. When can we expect the next release please? :)https://docs.sheetjs.com/docs/installation/ 0.18.9 (which does not include the commit) was pushed on Jun 9. We are aiming for 0.19.0 with some much-needed date changes, but could release a 0.18.10 if Numbers is significant enough to be prioritized
Ah, npm website's latest version is still 0.18.5, I didn't notice you changed the installation to provide package yourself. 😅
Thanks for the heads up, I have a workaround so I'll wait for next release.
This patch was rolled out.
To be clear, Numbers maps the
@
number format to a cell with type Text.The number format can be applied by setting the
z
property of the cell object:When using a method like
aoa_to_sheet
orsheet_add_aoa
, a cell object can be passed: