I use Apache POI and I have a lot of data that I want to write to *.xls file in parts. Now I use:
FileOutputStream fileOutputStream = null;
File tmpFile = new File("blabla.xls");
Workbook workbook = null;
try {
for(int i = 1; i <= pageNumber; i++) {
workbook = xlsGenerator.generateWorkbook(someData, i);
fileOutputStream = new FileOutputStream(tmpFile);
workbook.write(fileOutputStream);
}
}
But it doesn't work. It always replace old data instead of appending new data to workbook. So, are there ways to write in parts?