0
我想使用PrimeFaces將數據表導出到csv和xls,但文件下載後,它沒有文件格式。Primefaces <p:dataExporter>下載沒有格式
我點擊導出按鈕,將文件保存到我的磁盤,而不是被保存爲日常的report.xls它只是將其保存爲每天後。
奇怪的是這種情況發生在Firefox上,當我使用chrome時,它以文件格式正確地導出文件。我正在使用PrimeFaces 5.1。
下面是我對導出按鈕
<p:commandLink id="exportExcel" title="Export to Excel" ajax="false">
<p:dataExporter type="xls" target="report" fileName="daily report" />
<h:graphicImage library="img" name="icons/excel-file-icon.svg" styleClass="icon-medium" />
</p:commandLink>
<p:commandLink id="exportCsv" title="Export to CSV" ajax="false">
<p:dataExporter type="csv" target="report" fileName="daily report" />
<h:graphicImage library="img" name="icons/csv-file-icon.svg" styleClass="icon-medium" />
</p:commandLink>