Apache POI from version 3.6 onwards has support for SpreadSheetML (Microsoft’s Open Office XML standard). With SpreadSheetML you can generate Excel files as XML. The XML file needs to be compliant with the OOXML schema. The file extension for “.xlsx”.
To create a Excel document using OOXML use the command:
Workbook wb = new XSSFWorkbook();
To create in binary (OLE) format, use the below constructor for creating the workbook:
Workbook wb = new HSSFWorkbook();
That’s all! All further processing is the same for both XSSF and HSSF workbook formats.