我使用PrimeFaces Extension使用其数据表rowExpansion
导出数据,因为原生PrimeFaces不支持这种结构。为了实用,我不想写纯正的iText代码。
HTML:
<p:commandLink id="csv" ajax="false">
<h:outputText value="CSV" />
<f:setPropertyActionListener value="false" target="#{panoramicaMB.customExporter}" />
<pe:exporter type="csv"
target="tabela"
fileName="panoramicas"
facetBackground="#AAFFBB"
datasetPadding="4" />
</p:commandLink>
属性customExporter
是一个原始布尔值。我从isCustomExporter()
更改为getCustomExporter()
。两个名字的结果相同。
部分堆栈跟踪:
java.lang.IllegalArgumentException: No enum constant org.primefaces.extensions.component.exporter.DefaultExporterFactory.ExporterType.CSV
at java.lang.Enum.valueOf(Enum.java:238)
at org.primefaces.extensions.component.exporter.DefaultExporterFactory$ExporterType.valueOf(ExporterFactoryProvider.java:57)
at org.primefaces.extensions.component.exporter.DefaultExporterFactory.getExporterForType(ExporterFactoryProvider.java:67)
at org.primefaces.extensions.component.exporter.DataExporter.processAction(DataExporter.java:174)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
at br.com.shelfpix.filters.FiltroDeConexao.doFilter(FiltroDeConexao.java:230)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
at ...
答案 0 :(得分:0)
来自PrimeFaces Extensions的文档:
type Export type: "pdf","xlsx".
似乎不支持CSV。