0

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?

Dani
  • 3,744
  • 4
  • 27
  • 35
user1048261
  • 263
  • 4
  • 15

0 Answers0