How can i export data in PrimeFaces Extensions Sheet like PrimeFaces DataTable?
I tried PrimeFaces DataTable exporter like below but it doesn't support sheet table.
<p:commandButton value="XLS" styleClass="mr-2 mb-2">
<p:dataExporter type="xls" target="mainForm:sheet" fileName="department"/>
</p:commandButton>
It throws org.primefaces.extensions.component.sheet.Sheet cannot be cast to org.primefaces.component.datatable.DataTable exception. How can I use data exporter for PrimeFaces Extensions Sheet.
JSF: 2.2.1, PrimeFaces: 12.0.0, PrimeFaces Extensions: 12.0.5
As the exception shows, and what the documentation states,
p:dataExporter"must point to a PrimeFacesDataTable".As
Sheetdoes not extendDataTable,p:dataExporterwill not work with it.Options to get it working are:
Sheetto extendDataTable. I did not investigate this, and do not know if this is possible at all.You could create an issue to request export support for sheets. It would be even better if you would provided a pull request with it.