Reputation: 113
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
Upvotes: 2
Views: 274
Reputation: 20158
As the exception shows, and what the documentation states, p:dataExporter
"must point to a PrimeFaces DataTable
".
As Sheet
does not extend DataTable
, p:dataExporter
will not work with it.
Options to get it working are:
Sheet
to extend DataTable
. 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.
Upvotes: 1