How write data into Excel using POI

Hi

I am getting data from the Excel sheet using POI

Here, How to write data into excel File.

Train Asked on January 2, 2015 in Selenium WebDriver.
Add Comment
  • 1 Answer(s)

    you can do this by

    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet sheet = workbook.createSheet(“FirstExcelSheet”);
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell(0);
    cell.setCellValue(“your output text”);
    row.createCell(2).setCellValue(“your output text”);

    workbook.write(new FileOutputStream(“D:\\MyExcelData.xls”));

    Train Answered on March 11, 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.