Andrei Statescu
Andrei Statescu

Reputation: 329

Could Not Auto-size Column in p:dataExporter

I'm trying to use PrimeFaces DataExporter to export an xlsxstream type of file, but I seem to be getting this error:

WARNING: Could not auto-size column. Make sure the column was tracked prior to auto-sizing the column.
java.lang.IllegalStateException: Could not auto-size column. Make sure the column was tracked prior to auto-sizing the column.
    at org.apache.poi.xssf.streaming.SXSSFSheet.autoSizeColumn(SXSSFSheet.java:1606)
    at org.apache.poi.xssf.streaming.SXSSFSheet.autoSizeColumn(SXSSFSheet.java:1560)
    at org.primefaces.component.export.ExcelExporter.export(ExcelExporter.java:85)
    at org.primefaces.component.export.DataExporter.processAction(DataExporter.java:145)
    at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
    ...

Any idea how to debug this, or what the cause might be?

Upvotes: 2

Views: 2329

Answers (1)

Melloware
Melloware

Reputation: 12019

Bug reported to PrimeFaces: https://github.com/primefaces/primefaces/issues/4034

I fixed it for PF 6.3: https://github.com/primefaces/primefaces/pull/4035

Upvotes: 2

Related Questions