IR_to_MSExcel
IR_to_MSExcel copied to clipboard
Reduce file size?
Is there a way to make the Excel file smaller? I have an export with lots of columns and data and want to reduce the overhead.
In my example I do a download and the file is 2,6MB. When I open the file in Excel and save it there it's just 288KB in size.
When I open the file in Excel and save it there it's just 288KB in size. Did you save in XLS or XLSX format?
XLSX format
Found a solution, but it results in another problem.
Updated the shim.min.js and xlsx.full.min.js to the latest version from SheetJS: https://github.com/SheetJS/js-xlsx/tree/master/dist
Then added the compression: true option to the write procedure: wbout = XLSX.write(wb, {bookType:'xlsx', compression:true, bookSST:true, type: 'binary'});
Now the file is only 2MB.
But the latest version also gives the problem that the heading has no color, so I don't know if this is the correct solution for all situations. For me it solves this filesize issue and the file generation is also faster.
It is really necessary to reduce file size? XLSX is build on the client side - in browser - and does not require additional time to be downloaded from server, but can take more client resources for archiving.
It sure does, especially when dealing with larger reports. Using the new version makes the file creation much quicker. From a minute to a few seconds in my case.