When i am running my
thread it says.
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
Code >>>
salesFileName is the name of the File .
//File salesFile = new File(destDir + salesFileName);
InputStream inputStream = null;
try {
inputStream = new FileInputStream(destDir);
} catch (FileNotFoundException e) {
System.out.println("File not found in the specified path.");
e.printStackTrace();
}
try {
fileSystem = new POIFSFileSystem(inputStream);
XSSFWorkbook workBook = new XSSFWorkbook(salesFileName);
XSSFSheet sheet = workBook.getSheetAt(0);
totalRows = sheet.getPhysicalNumberOfRows();
System.out.println("total no of rows >>>>"+totalRows);
} catch (IOException e) {
e.printStackTrace();
}
Also In Reading and Writing section
It is using WorkBookFactory...
Workbook wb = WorkbookFactory.create(inp);
If we are talikng about poi then why my
IDE is asking to import .jxl (API for Workbook)