When using Apache POI to read and write Excel in Java, the types of components supported differ depending on the version of Excel, and there were versions that could not be used, so I decided to summarize it as a memorandum. (If you make a mistake, please let me know.)
First, let's take a brief look at Apache POI. Apache POI is a library that allows Java programs to read and write Office files. > Apache POI official website
There are three types of components for reading and writing Excel, and the one used depends on the extension and usage.
component | Read | write | extension | Corresponding version |
---|---|---|---|---|
HSSF | 〇 | 〇 | .xls | Excel 97-Excel 2003 (BIFF 8) |
XSSF | 〇 | 〇 | .xlsx | Excel 2003- (OOXML) |
SXSSF | × | 〇 | .xlsx | Excel 2003- (OOXML) |
HSSF and XSSF are used during normal reading and writing according to the version of Excel.
This time I briefly summarized the versions and components of Excel that can use Apache POI, but I hope to summarize how to use Apache POI at a later date.
Recommended Posts