Bug 65465

Summary: createFreezePane not working with DeferredSXSSFWorkbook
Product: POI Reporter: mwisnicki <mwisnicki>
Component: SXSSFAssignee: POI Developers List <dev>
Status: RESOLVED INFORMATIONPROVIDED    
Severity: normal    
Priority: P2    
Version: 5.0.x-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description mwisnicki 2021-07-27 04:49:38 UTC
I've tried calling createFreezePane(0,1) both before and after first call to createRow but it's not doing anything.

Similar code works with SXSSFWorkbook.


<code>
try (var wb = new DeferredSXSSFWorkbook(10)) {
  wb.createSheet().setRowGenerator(sheet -> {
    sheet.createFreezePane(0,1);
    var row = sheet.createRow(0);
    var cell = row.createCell(0, CellType.STRING);
    cell.setCellValue("header1");
  });
  wb.write(os);
}
</code>
Comment 1 PJ Fanning 2021-07-27 09:04:41 UTC
what happens if you do the freeze pane call outside the row generator function? eg before setting the row generator or after setting the row generator
Comment 2 mwisnicki 2021-07-27 12:48:59 UTC
Thanks! It works.

IMHO if this is the only way supported, there should at least be a runtime exception when method is called in wrong context. Along with JavaDoc note.
Comment 3 PJ Fanning 2021-07-31 21:03:58 UTC
I'll see about updating the docs.