IR_to_MSExcel icon indicating copy to clipboard operation
IR_to_MSExcel copied to clipboard

Reduce file size?

Open p3t3r opened this issue 6 years ago • 5 comments

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.

p3t3r avatar Sep 24 '18 08:09 p3t3r

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?

glebovpavel avatar Sep 24 '18 12:09 glebovpavel

XLSX format

p3t3r avatar Sep 24 '18 13:09 p3t3r

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.

p3t3r avatar Sep 26 '18 07:09 p3t3r

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.

glebovpavel avatar Jan 14 '19 16:01 glebovpavel

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.

p3t3r avatar Jan 15 '19 07:01 p3t3r