I have some Java code which reads the Excel data. On running the Java code, it\'s showing the following error. Help me resolve the same. Also, I need to know other method of
you are using the wrong class for reading the file HSSFWorkbook
is for old excel format. use XSSFWorkbook
instead
Edited: copied from http://www.coderanch.com/t/463779/java/java/read-xlsx-sheet-Client-Side. did u do the same thing?
try {
System.out.println("destDir==> "+destDir);
XSSFWorkbook workBook = new XSSFWorkbook(destDir);
XSSFSheet sheet = workBook.getSheetAt(0);
totalRows = sheet.getPhysicalNumberOfRows();
System.out.println("total no of rows >>>>"+totalRows);
} catch (IOException e) {
e.printStackTrace();
}
Edit 2: Learn about apache POI from this link