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
|
workbook = new XSSFWorkbook();
//for .xlsx workbook use HSSworkbook();
//Create sheet
sheet = workbook.createSheet("Tasks");
// dont know if it is the right function to do it ?
sheet.setRightToLeft();
//Create top row with column headings
String [] ColumnHeadings = {"Text Area","Field Comment","Date","Date Begin","Date Finish"};
........
// and populate it with data
int rownum = 1;
for(Task_User task : list_task) {
row = sheet.createRow(rownum++);
row.createCell(0).setCellValue(task.getAreaDescription());
row.createCell(1).setCellValue(task.getField_Comment());
Cell dateCell = row.createCell(2);
dateCell.setCellValue(task.getDate());
dateCell.setCellStyle(dateStyle);
Cell date_beginCell = row.createCell(3);
date_beginCell.setCellValue(task.getDate_begin());
date_beginCell.setCellStyle(dateStyle);
Cell date_finishCell = row.createCell(4);
date_finishCell.setCellValue(task.getDate_finish());
date_finishCell.setCellStyle(dateStyle);
} |
Partager