1

I am using Java + Apache POI to generate an excel file (format xlsx/xls). Due to huge data the generated excel file (format xlsx/xls) takes more size (~50 MB).

So I am trying to convert xlsx/xls to xlsb to reduce the size of the excel file.

Here is the problem: Apache POI does not support writing to xlsb file. So what I am trying is:

  1. Generate a xlsx/xls file using Apache POI.
  2. After that convert generated xlsx/xls to xlsb. For this I am using SmartXls Java library. But this library is not open source. You need to buy license for this. Also I checked EasyXls Java library, but it also requires buying a license.

Below code is used to convert xlsx/xls to xlsb using SmartXls Java library:

WorkBook wb = new WorkBook();
wb.readXLSX(.../xlsxPath);
wb.writeXLSB(new java.io.FileOutputStream(.../xlsbPath));
wb.dispose();

Kindly someone help me whether any open source library is available for it or is there any other way to do this conversion in Java.

Thanks in advance.

curiousMinded
  • 336
  • 3
  • 16
Parthiban
  • 105
  • 4
  • 16
  • Generally `.xlsx` is pretty similar sizes to `.xlsb` files, what makes you think you'd get any noticable savings? – Gagravarr Oct 28 '19 at 21:27
  • No. xlsx and xlsb has some different in terms of size, loading and closing. Ex: If xlsx size is 10 MB, after convert to xlsb the size reduced to ~4-5 MB. Try to save xlsx file to xlsb using Excel application. You can see the difference. – Parthiban Oct 28 '19 at 21:47
  • Hi, Is any one know how to do that? – Parthiban Oct 30 '19 at 15:09
  • There isn't any free Excel library that knows xlsb file format. Even for money, there are only a few. – alex.pulver Nov 01 '19 at 07:07

0 Answers0