Ok so Im iterating over a list and instead of inserting values into cells horizontally, im putting the values in the cells vertically.
It works fine for the first ti
You're creating a row each time, you want to check if the row exists first. Something like this will work.
myRow = sheet.getRow((short)row);
if (myRow == null) {
myRow = sheet.createRow((short)row);
}
Also, in your current code, each time you're recreating the row at 0 twice.
Row myRow = sheet.createRow ((short)row);
myRow.createCell(k).setCellValue (dataList.getVal()));
myRow = sheet.createRow ((short)row++); // Here, you're creating a new row at index 0
akokskis answer is good, actually better, either create them as he did before iterating or check if it exists first.