I am trying to create sheets in a new workbook using apache poi.
However, I want the sheets created to be the name of studies in an arraylist.
I don't know how many studies there are, or what they are beforehand. I am having trouble setting it up.
public static void addSheets() {
XSSFWorkbook finalizing = new XSSFWorkbook();
for (int i = 0; i < studies.size(); i++) {
finalizing.createSheet(studies.get(i));
}
makeWorkBook(finalizing);
}
I have also tried
XSSFSheet firstSheet = finalizing.createSheet(studies.get(i));
instead of the finalizing.createSheet
But neither work.
I was hoping to get advice from anyone?