Export to excel button freezing browser with ~20,000 rows
Export to excel button freezing browser with ~20,000 rows
I am running into an issue and am hoping for some guidance, even if it is that I am going about this type of thing the wrong way. In any event, I have a datatable that is dynamically generated with data from a remote API. The table(s) contain a decently large quantity of data (up to 20k rows and 10-20 columns, some with HTML text of varying length).
Smaller exports (<10k rows) download, but it takes roughly 4-5. When I try to export the full table, though, the browser becomes unresponsive and the download never happens.
Does anyone have any suggestions? Should I expect a download of this size to not time out the browser? If so, are there any other options using the DataTables library?
Answers
You could try using DataTables 1.10.16. The newer releases have a performance regression that fix a bug, but cause the export to be a lot slower.
The alternative is to have the server-side script do the export for you.
Allan
Hi Allan,
Thank you for the quick reply. I did as you suggested and the export to CSV worked significantly faster, roughly 10 seconds for 21,000 rows opposed to 6-infinity minutes before.
DataTables is one of the most flexible, lightweight, and easy to implement libraries I have come across in quite a while. Keep up the awesome work!
Thanks! Great to hear that helped. That is something that I will be fixing for the next release
Allan