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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| Cell c = null;
//Cell pleine
CellStyle cs = wb.createCellStyle();
cs.setFillForegroundColor(HSSFColor.LIME.index);
cs.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//Cell vide
CellStyle csvide = wb.createCellStyle();
csvide.setFillForegroundColor(HSSFColor.WHITE.index);
csvide.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
// csvide.setUnderline(HSSFFont.U_SINGLE);
// my_style.setFont(my_font);
//New Sheet
HSSFSheet sheet1 = wb.getSheetAt(0);
//Sheet sheet1 = null;
//sheet1 = wb.createSheet("Intervention2");
/////////////////
/////////////////
// Generate column headings
////////////////////////////////////ICI a rajputer +1
//int rownum = sheet1.getLastRowNum();
int rownum = sheet1.getLastRowNum()+1;
Log.d("Debug", String.valueOf(rownum));
//////////////////////////////
//Update the value of cell
// Row row = sheet1.getRow(0);
// row.createCell(3).setCellValue("Value 2");
/////////////////////////////////
Row row = sheet1.createRow(rownum);
//Row row1 = sheet1.createRow(1);
c = row.createCell(11);
c.setCellValue("");
c.setCellStyle(csvide);
c = row.createCell(10);
c.setCellValue("");
c.setCellStyle(csvide);
c = row.createCell(9);
c.setCellValue("");
c.setCellStyle(csvide);
c = row.createCell(8);
c.setCellValue("");
c.setCellStyle(csvide);
c = row.createCell(0);
c.setCellValue(orderName);
c.setCellStyle(cs);
c = row.createCell(1);
c.setCellValue(NameDate);
c.setCellStyle(cs);
c = row.createCell(2);
c.setCellValue(NameHeure);
c.setCellStyle(cs);
c = row.createCell(3);
c.setCellValue("");
c.setCellStyle(cs);
c = row.createCell(4);
c.setCellValue("");
c.setCellStyle(cs);
c = row.createCell(5);
c.setCellValue("");
c.setCellStyle(cs);
c = row.createCell(6);
c.setCellValue(NameDateNew);
c.setCellStyle(cs);
c = row.createCell(7);
c.setCellValue(NameHeureNew);
c.setCellStyle(cs);
sheet1.setColumnWidth(11, (15 * 300));
sheet1.setColumnWidth(10, (15 * 300));
sheet1.setColumnWidth(9, (15 * 300));
sheet1.setColumnWidth(8, (15 * 350));
sheet1.setColumnWidth(0, (15 * 500));
sheet1.setColumnWidth(1, (15 * 250));
sheet1.setColumnWidth(2, (15 * 200));
sheet1.setColumnWidth(3, (15 * 250));
sheet1.setColumnWidth(4, (15 * 250));
sheet1.setColumnWidth(5, (15 * 200));
sheet1.setColumnWidth(6, (15 * 200));
sheet1.setColumnWidth(7, (15 * 200)); |
Partager