public void readEXCEL() throws NumberFormatException, Exception{
Map<String, Object> params = super.getParameterObject();
List<CmwMaintenceBill> ls = new ArrayList<CmwMaintenceBill>() ;
List<CmwMaintenceBill> ls2 = new ArrayList<CmwMaintenceBill>() ;
try {
FileInputStream fis = new FileInputStream("d:/shmis20121031.xls");
Workbook rwb = Workbook.getWorkbook(fis);
Sheet rs = rwb.getSheet(0);
int rows = rs.getRows();
//int columns=rs.getColumns();
int n = 0; //定义几列,这里有三列
int c = 1;
for (int i = 1; i < rows; i++) {
String id = rs.getCell(n, i).getContents().trim();
String mbillNo = rs.getCell(c, i).getContents().trim();
System.out.println("维护单id===="+id);
System.out.println("维护单号===="+mbillNo);
}
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BiffException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Map<String, Object> params = super.getParameterObject();
List<CmwMaintenceBill> ls = new ArrayList<CmwMaintenceBill>() ;
List<CmwMaintenceBill> ls2 = new ArrayList<CmwMaintenceBill>() ;
try {
FileInputStream fis = new FileInputStream("d:/shmis20121031.xls");
Workbook rwb = Workbook.getWorkbook(fis);
Sheet rs = rwb.getSheet(0);
int rows = rs.getRows();
//int columns=rs.getColumns();
int n = 0; //定义几列,这里有三列
int c = 1;
for (int i = 1; i < rows; i++) {
String id = rs.getCell(n, i).getContents().trim();
String mbillNo = rs.getCell(c, i).getContents().trim();
System.out.println("维护单id===="+id);
System.out.println("维护单号===="+mbillNo);
}
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BiffException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}