HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet1 = workbook.createSheet("actions");
for (int i = 0; i < 10; i++) {
sheet1.createRow(i);
for (int j = 0; j < 10; j++) {
HSSFRow currRow = sheet1.getRow(i);
currRow.createCell(j);
HSSFCell currCell = currRow.getCell(j);
currCell.setCellType(1);
currCell.setCellValue("chanu" + j);
}
}
//write Excel sheet to file system
FileOutputStream output = new FileOutputStream("D:/text.xls");
workbook.write(output);
output.close();