I'm producing a large xlsx workbook with several worksheets. The data that will fill each worksheet comes from different sources (database queries, web services, etc.). I suppose that POI won't let you write multiple worksheets to the same file via multithreading. Hence, I'd like to create a single worksheet workbook for each source and, when all individual workbooks are created, aggregate them into one workbook (each original workbook in its own worksheet). I know that I will have to copy each worksheet, row by row, cell by cell into the aggregated worksheet.
Are there better approaches to doing this? As I copy each worksheet into the workbook (assuming I'm using SXSSF) could I run into memory issues as the aggregated workbook grows? In other words, even if I'm using SXSSF, when I open the file, is the whole file loaded into memory even before I start writing additional items to it?
