How to write into excel file to the particular cell.I have a method which accepts file location and row number to which i have to write into it.
What i tried is read the file then created a cell and set the value into it, but when i look into it the cell is still blank.
public void writeInExcelRowCell(String file , int rowNum) throws Exception {
FileInputStream excelFile = new FileInputStream(new File(file));
Workbook workbook = new XSSFWorkbook(excelFile);
Sheet sheet = workbook.getSheetAt(0);
sheet.getRow(rowNum).createCell(2).setCellValue("DONE");
sheet.getRow(rowNum).createCell(3).setCellValue("PENDING");
workbook.close();
}