Format whole column with numeric values #1339
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#1339
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?
I tried to add a formatter to my table columns that applies a new format to numeric cells. I used this https://github.com/SheetJS/js-xlsx/issues/885 issue as a guide to my solution but it didn't seem to work.
Here's what I have:
When I debug this code, I see that worksheet[ref] is "undefined". Even though ref itself is not undefined (e.g. it's "NIAYPRLSVBUYWS15") and my worksheet is also filled with the correct data.
Am I doing something wrong?
Thanks in advacne!
Note I'd like to apply that format AFTER the table has been rendered!
Are you sure the cells are numeric? As a quick test, add the line
... and verify you are seeing a string of
n
for numeric cells.If I add the console.log part, it simply says "cannot read property "t" of undefined".
And yes, it's a numeric cell!
If there is formatted text, utilities will use the cached values. Delete the formatted text as follows:
That's not working either and if you ask me, I understand why. worksheet[ref] is not defined, so you also can't delete it. The error must be somewhere earlier in the code, where worksheet[ref] is defined?
@SheetJSDev Still looking for a solution!
Please, still looking for help @SheetJSDev
@sonjadeissenboeck A little late, and I'm sure you already checked this, but I don't see where you are defining 'worksheet'. You need to add something like this
var worksheet = XLSX.utils.json_to_sheet(arrayOfObjects);
To format the entire column, there are three parts:
cellStyles: true
:Step 2 is not currently supported. Fortunately the patch is fairly straightforward. Modify
bits/67_wsxml.js
: