I have data stored in ArrayList ,and i want to write that data in excel workbook in multiple sheets. I am able to write data in excel workbook, but it's writing in same sheet. As of now i am able to write data in the following way, as shown below in the pic:
But I want to break data into multiple sheets, Data should break from headers i,e S.NO,Col1...Col6, when ever this comes up, the data should write to new sheet.
I am using this code to write data into excel
for (int i = 0; i < listOfResults.size(); i++) {
row = sheet.createRow(i);
for (int j = 0; j < 7; j++) {
cell = row.createCell(j);
if (j + add < listOfResults.size()) {
cell.setCellValue(listOfResults.get(j + add));
}
}
add += 7;
}
Please help..

sheetin your code?