ParamQuery grid support forum

General Category => Bug Report => Topic started by: wd_perf on September 28, 2022, 04:22:46 am

Title: Large Excel export causes browser crash
Post by: wd_perf on September 28, 2022, 04:22:46 am
Previous topic: https://paramquery.com/forum/index.php?topic=3908.0

I believe the crash with large data sets may be caused because of the JSZip.generate function used. According to https://stuk.github.io/jszip/documentation/faq.html the generateAsync function would do better at avoiding browser crashes.

Would you be able to update the JSZip version used to take advantage of generateAsync?
Title: Re: Large Excel export causes browser crash
Post by: wd_perf on October 19, 2022, 06:06:55 am
Upon further review, it looks like the crash happens before the zip, in getBody().
Title: Re: Large Excel export causes browser crash
Post by: paramvir on October 19, 2022, 11:22:28 am
Can you please attach sample Excel file which causes browser crash so that I can check it at my end.
Title: Re: Large Excel export causes browser crash
Post by: wd_perf on October 25, 2022, 01:49:07 am
Hello, yes.
https://www.stats.govt.nz/assets/Uploads/International-trade/International-trade-June-2022-quarter/Download-data/international-trade-june-2022-quarter-csv.zip
In that zip file, the output_csv_full.csv can be imported but when exported in Excel format it crashes the browser tab.
Thank you.
Title: Re: Large Excel export causes browser crash
Post by: wd_perf on October 26, 2022, 10:00:45 am
Hello again. I was able to get it working by removing all .join("") calls and modifying getSheet() to return buffered content as shown here: https://stackoverflow.com/a/46888173
Title: Re: Large Excel export causes browser crash
Post by: wd_perf on October 29, 2022, 05:26:18 am
Actually, that was breaking on very very large exports. I had to rewrite things to take advantage of JSZip3's support for Node streams in the file creation function.