Hello,
Here is a sample based on apache POI.
public void fillData(int[] intArr)
{
int startCell = 6;
HSSFWorkbook workbook = null;
HSSFSheet sheet = null;
HSSFCell cell = null;
HSSFRow sheetRow = null;
workbook = new HSSFWorkbook();
sheet = workbook.createSheet("WorkSheet");
sheetRow = getRow(sheet, 0);
for (int val : intArr)
{
cell = sheetRow.createCell(startCell);
cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
cell.setCellValue(((Integer) value).doubleValue());
}
}
protected final HSSFRow getRow(HSSFSheet sheet, int rowNum)
{
HSSFRow sheetRow = null ;
sheetRow = sheet.getRow(rowNum);
if (null == sheetRow)
sheetRow = sheet.createRow(rowNum);
return sheetRow;
}
More info can be found at Apache POI Site[
^].
Regards,