Bug 65465 - createFreezePane not working with DeferredSXSSFWorkbook
Summary: createFreezePane not working with DeferredSXSSFWorkbook
Status: RESOLVED INFORMATIONPROVIDED
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 5.0.x-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-27 04:49 UTC by mwisnicki
Modified: 2021-07-31 21:03 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.