15

HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format.

Are there any export limitations when using HSSF?

I've once read somewhere that Excel '97 just supported <65.000 Entries.

Is it safe to use HSSF to export excel sheets with more than 65.000 Entries, or why would I use XSSF?

0x45
  • 779
  • 3
  • 7
  • 26
  • 1
    65536 is an excel 97 to 2003 limit, so you can't have xls files with more than 65536 rows. Hence HSSF will work just fine with **xls** files, as the limit is xls and not HSSF. **xlsx** files support up to 1M+ rows, and XSSF will handle them correctly. – BackSlash Aug 29 '17 at 10:07
  • Ah the edit makes it clearer. so for no misunderstanding, you recommend me to take XSSF to support more Entries without data loss? @BackSlash – 0x45 Aug 29 '17 at 10:09
  • 1
    Yes, use xlsx. xls doesn't support more than 65536 entries. – BackSlash Aug 29 '17 at 10:10

1 Answers1

21

As you can see here Excel 97 to 2003 supports a maximum of 65,536 rows. So no, with HSSF you won't be able to store more than 65536 entries. However you can do it with XLSX (Excel 2007+) which can handle up to 1,048,576 rows and can be saved using XSSF. It won't be compatible with Excel 97/2003 though.

BackSlash
  • 21,927
  • 22
  • 96
  • 136