public void readExcelFile() {
try {
Workbook book = Workbook.getWorkbook(new File(Environment.getExternalStorageDirectory().getPath()+"/mytest.xls"));
System.out.println(">>>>>>number of sheet "+book.getNumberOfSheets());
// 获得第一个工作表对象
Sheet sheet = book.getSheet(0);
int Rows = sheet.getRows();
int Cols = sheet.getColumns();
System.out.println("当前工作表的名字:" + sheet.getName());
System.out.println("总行数:" + Rows);
System.out.println("总列数:" + Cols);
for (int i = 0; i < Rows; ++i) {
for (int j = 0; j < Cols; ++j) {
// getCell(Col,Row)获得单元格的值
System.out.print((sheet.getCell(j, i)).getContents() + "\t");
}
System.out.print("\n");
}
book.close();
} catch (Exception e) {
System.out.println(e);
}
}