No Branch/Tag Specified
master
sankhavaramsaitulasiram/feat-fix-2752
maybeswapnil/issue2737
gh-pages
scottysseus/2560_2
ivan-trusov/fix-basedate
nandanv2702/issue_1300
protobi/master
ThomasChan/master
grantfayvor/master
tom-groves/bug-1105/rounding-error
mgreter/master
v0.87
v0.9.9
v0.9.8
v0.9.7
v0.9.6
v0.9.5
v0.9.4
v0.9.3
v0.9.2
v0.9.13
v0.9.12
v0.9.11
v0.9.10
v0.9.1
v0.9.0
v0.8.8
v0.8.7
v0.8.6
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.9
v0.7.7
v0.7.6-i
v0.7.6-h
v0.7.6-a
v0.7.6
v0.7.5
v0.7.4
v0.7.3
v0.7.2
v0.7.11
v0.7.10
v0.7.1
v0.5.9
v0.5.8
v0.5.7
v0.5.10
v0.5.0
v0.4.3
v0.19.3
v0.19.2
v0.19.1
v0.19.0
v0.18.9
v0.18.8
v0.18.7
v0.18.6
v0.18.5
v0.18.4+deno
v0.18.4
v0.18.3
v0.18.2
v0.18.12
v0.18.11
v0.18.10
v0.18.1
v0.18.0+deno
v0.18.0
v0.17.5
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.8
v0.16.7
v0.16.6
v0.16.5
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.6
v0.15.5
v0.15.2
v0.14.0
v0.13.5
v0.13.4
v0.13.3
v0.13.1
v0.13.0
v0.12.9
v0.12.8
v0.12.7
v0.12.6
v0.12.5
v0.12.4
v0.12.3
v0.12.2
v0.12.13
v0.12.12
v0.12.11
v0.12.10
v0.12.1
v0.12.0
v0.11.9
v0.11.8
v0.11.7
v0.11.6
v0.11.5
v0.11.4
v0.11.3
v0.11.2
v0.11.19
v0.11.18
v0.11.17
v0.11.16
v0.11.15
v0.11.14
v0.11.13
v0.11.12
v0.11.11
v0.11.10
v0.11.1
v0.11.0
v0.10.9
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Assignees
Assign users
Clear assignees
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2816
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
导出数据量较大100万行,每行21列,每行大概300个字符
版本:0.16.9
尝试1:每20万行追加sheet1中,数据请求完后统一下载
尝试2:每20万行放入1个sheet中,数据请求完后统一下载
2种方式,都是chorme不能完成,Safari可以完成
Chrome:
在writeFile的时候直接崩溃,XLSX.writeFile(o.wb, o._option.filename + '.xlsx' , {compression: true, type: 'binary'}), 其中加opts也不行
Safari:
可以下载成功,{compression: true, type: 'binary'}添加后文件下载的大小相差十几倍
问题: chrome怎样才能下载成功,什么导致的下载失败
错误:有时报错
RangeError: Invalid string length
at Array.join
https://docs.sheetjs.com/docs/miscellany/errors#aw-snap-or-oops-an-error-has-occurred
Please try upgrading to 0.19.0 and calling
writeFile
with the optiondense: true
. This won't resolve the "Invalid string length" issue but it should avoid other crashes in Chrome.To fix the "Invalid string length" we need to change how the writer works. Currently a large XML string is generated. In Chrome, the string length limit is 0x1FFFFFE8 (536870888) characters, so the writer will need to generate the file without assembling the entire string.
多谢大佬回复。可是目前还有一定几率下载失败
请问有没有办法减少内存使用,80万行数据,每20万1个sheet,内存占用到了1.3G,如下:
XLSX.utils.book_append_sheet(o.wb, XLSX.utils.aoa_to_sheet(o.content), sheet)
但是到调用下载时,内存飙升到3.4G,如下
XLSX.writeFile(o.wb, o._option.filename + '.xlsx' , {compression: true})
上面3个方法,有没有对应的opts来减少内存的占用
XLSX.writeFile(o.wb, o._option.filename + '.xlsx' , {compression: true})
这个方法,加了opts {compression: true} 之后,80万行下载后文件大小为110多M,没加这个opts之前,下载80万行数据的文件大小为800多M
You will need to update to the latest version. https://docs.sheetjs.com/docs/getting-started/#installation has instruction links for standalone script tag and for bundlers like React projects.
Using the latest version, try:
800K rows x 10 columns live demo https://jsfiddle.net/3ksfq7n9/ runs in 15 seconds (Macbook Pro 2018)
Fiddle Code (click to show)