This article is a mirror article of machine translation, please click here to jump to the original article.

View: 32482|Reply: 0

[Source] POI uses three methods: HSSF, XSSF, SXSSF

[Copy link]
Posted on 5/14/2021 10:25:45 AM | | |
POI provides three ways to operate Excel: HSSF, XSSF, and SXSSF.

HSSF: Excel 97-2003 version with .xls extension. The maximum number of rows in a sheet65536, the maximum number of columns is 256.

XSSF: Excel 2007 version with .xlsx extension. The maximum number of rows in a sheet1048576, the maximum number of columns is 16384.

SXSSF: It is an operation method that supports low memory footprint based on XSSF and is available in POI 3.8 with a .xlsx extension.

Excel version compatibility is backward compatible.

Three types of interfaces and methods:

HSSF:HSSFWorkbook、HSSFSheet、HSSFRow、HSSFCell……

XSSF:XSSFWorkbook、XSSFSheet、XSSFRow、XSSFCell……

SXSSF:SXSSFWorkbook、Sheet、Row、Cell……


Obviously, SXSSF is special, except for workBooks with prefixes, the rest have no prefixes. Both HSSF and XSSF have their own prefixes. So it's easy to switch between setting formats and so on.

It's important to note that SXSSF is a low-memory operation because of its construction:



This 100, you can understand that when POI operates, there are only 100 rows of data in memory at most, and when this data is exceeded, the data before memory is deleted, and temporary files are generated on the hard disk. This guarantees low memory consumption. Of course, you can also increase this number a bit.




Previous:ASP.NET Detailed explanation of the Middleware middleware of Core (9).
Next:NPOI judgment of cell date type
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com