sheet_to_html does not work with blankrows: false option #2272
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#2272
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?
sheet_to_json and sheet_to_csv both skips blank rows, if the { blankrows: false } option is given
But sheet_to_html does not look at this option,
and so if the worksheet is ending with lots of blank rows (eg. excel can output a sheet with 65565 rows, even if only 10 rows are filled)
then the resulting html has thousands of blank rows.
We can fix this by testing the w value to see if its empty
after xlsx.mini.js Line8467
just like the other 2 functions sheet_to_json and sheet_to_csv both does this check.
If I fix this in sheet_to_html, would it be possible to pull the pull_request?
We could be convinced to accept a PR.
The big challenge with sheet_to_html is interpretation of rowspan (merge cells). CSV and JS row objects / array of arrays don't have a native concept of "merging" -- data is written as if it were in the upper-left cell of the merge range.
Consider the example:
Are rows 2 and 5 blank? After all, the real data is present in cells A1 / B1 / B3 / C4. If they aren't blank, then it's unclear what
blankrows
really does. If they are blank, then the rowspan in row 1 would have to be adjusted.