Java POI the supplied data appears to be in the Office 2007+ XML

According to the Apache POI Quick Guide, the POIFSFileSystem (or similarly, NPOIFSFileSystem) is only used with .xls (Excel versions through 2003) documents. The equivalent for .xlsx documents (Excel 2007+) is OPCPackage. OPCPackage pkg = OPCPackage.open(new File(“file.xlsx”)); You can create an XSSFWorkbook from the OPCPackage: XSSFWorkbook wb = new XSSFWorkbook(pkg); Or you can just create it … Read more

Excel Cell Style issue

If the cell, which is containing the date, is formatted as the default date format (Short Date), then only the format id 0xE (14) is stored in the file. See https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/BuiltinFormats.html. The *.xlsx file contains only <xf numFmtId=”14″ … applyNumberFormat=”1″/> in styles.xml. There is no special formatCode saved for this numFmtId. So how this will … Read more