andreyan-andreev / node-excel-export

130 stars 52 forks source link

Incredible huge file size #22

Closed pts011080 closed 4 years ago

pts011080 commented 7 years ago

I encountered some weird situation. When I first write the buffer into file it show up the file size like 100MB. But then it reduced to 15MB after I've open it at Excel and Save it without any modification.

Any idea of this?

mohnish4795 commented 7 years ago

Getting same problem here, the file is tremendously large and it gets reduced just by re-saving the excel in MS Excel!! Any Solution regarding this issue?

andreyan-andreev commented 7 years ago

Hello guys, In general this package is nothing more than a thin wrapper around https://github.com/protobi/js-xlsx , so all it gives is a little bit more easy way to work the library. I really do not know what may causing the issue, maybe your dataset is too big maybe something else. You can try to use js-xlsx directly and see if this solves the problem.

mohnish4795 commented 7 years ago

Hey, I don't have a complete solution but kind of a workaround. The reason behind this issue is xlsx-style module which is integrated underneath this module. If I change it from xlsx-style to xlsx then everything seems to work perfectly without any size problem. But then I lose some of the styling functionality!!

@andreyan-andreev Please can you take a look into it.

mohnish4795 commented 7 years ago

Okay I went into depth of the code to find what was messing things up, and found that the zip compression algorithm is not yet updated in xlsx-style as it is in xlsx.

So the solution will be to add compression property into write options of this module but it won't work until and unless xlsx-style gets updated.. Check the same issue caused in original module: Issue

shdb1993 commented 4 years ago

Using ExcelJS package solved the issue for me ExcelJS