Some text in string cell broken Exel #1341
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#1341
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?
Hello! I have a generated file. In Numbers or LibreOffice he open correct. But if I open he by Excel all broken. Excel error log don't give anything info. Can you please check it? Archive with file in attach
big6.xls.zip
There's a neat BIFF format validator at https://www.microsoft.com/en-us/download/details.aspx?id=26794 -- the output gives you a sense for where to look in the binary stream.
One cell has an extremely long string, whose byte representation is about 10K bytes. Excel enforces this 8224 byte rule (so writers would have to create "Continue" records and split up the original string into chunks) but other tools don't. Since we aren't generating the continue structure, Excel is choking.
To generate a valid file, try taking a slice of the first 1000 characters of the string.
Thanks! Could you please give me link on some information about "Continue records"?
The conceptual overview is covered in
[MS-XLS] 2.1.4 Record
.On the parsing side, the
slurp
function takes a peek at the next record to decide if there is a continuation.If you are interested in contributing a fix,
write_biff_rec
takes a payload and generates the appropriate header and record. That part should inspect the payload length and, if it is greater than 8224, split it up into blocks of 8224 bytes with Continue records (record type 0x3c)Thanks! But I have a problem on some first step.
I understend, what continue record algorithm has some parts:
But when I tried slice/split input buffer and get first part with length 8224 and write only it the output file was broken.
Example:
Existing code:
My example code:
Maybe I don't no how correct slice a part of buffer?
@SheetJSDev can you give me some answer please?
When writing long strings using the shared string table (
bookSST: true
), Continue records are generated.The inline strings (Label records) are capped at 255 characters. To wrap up the issue, we'd accept a PR that enforces the length by slicing and optionally warning. The places to slice are
https://github.com/SheetJS/sheetjs/blob/master/bits/78_writebiff.js#L72
https://github.com/SheetJS/sheetjs/blob/master/bits/78_writebiff.js#L198