The file size I exported was about double the actual value #2988
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#2988
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?
The file size I exported was about double the actual value, but if I open it and save it directly, I can get it back to normal size.
The attached table was generated by my test code, and I omitted some data
Figure 1 shows the test file before and after it was saved
Figure 2 shows the actual file before and after saving
//This is my test code: let tempData=[ { 'test1':'t1', 'test2':'t2', 'test3':'t3', 'test4':'t4', 'test5':'t5', 'test6':'t6' },{ 'test1':'t1', 'test2':'t2', 'test3':'t3', 'test4':'t4', 'test5':'t5', 'test6':'t6' } ] let result={'test1':'test1','test2':'test2','test3':'test3','test4':'test4','test5':'test5','test6':'test6'} const sheet = [result, ...tempData]; const worksheet = XLSX.utils.json_to_sheet(sheet, { skipHeader: true, }); XLSX.utils.book_append_sheet(newWorkBook, worksheet, sheetList[i]); XLSX.writeFileXLSX(newWorkBook, "test.xlsx", { compression: true });
Just open the file and save it, and the size of the file changes
There's a tradeoff between runtime performance and compression size. This has been asked multiple times and we will be revisiting this in the future. #2974 tracking issue