1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
public void openExcel(String file, ArrayList list_equip){
int i =4;
String equip[] = new String[6];
try {
workbook = Workbook.getWorkbook(new File(file));
sheet = workbook.getSheet("Bilan");
Cell cell_fichier = sheet.getCell(1,i);
Cell cell_equip = sheet.getCell(7,i);
Cell cell_local = sheet.getCell(6,i);
Cell cell_niveau = sheet.getCell(3,i);
Cell cell_service = sheet.getCell(4,i);
Cell cell_salle = sheet.getCell(5,i);
while (cell_equip.getContents() != ""){
cell_fichier = sheet.getCell(1,i);
cell_equip = sheet.getCell(7,i);
cell_local = sheet.getCell(6,i);
cell_niveau = sheet.getCell(3,i);
cell_service = sheet.getCell(4,i);
cell_salle = sheet.getCell(5,i);
equip[5] = cell_fichier.getContents();
equip[0] = cell_equip.getContents();
equip[1] = cell_local.getContents();
equip[2] = cell_niveau.getContents();
equip[3] = cell_service.getContents();
equip[4] = cell_salle.getContents();
list_equip.add(equip);
System.out.println(((String[])list_equip.get(i-4))[2]);
i++;
}
//return list_equip;
} catch (BiffException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//return null;
} |
Partager