2

I am using PrimeFaces 6.1. I am trying to export a dataTable with footer using the dataExporter component. The footer is correctly exported for CSV and XLS formats but for PDF it simply refuses to include it. Tried using both p:column's footerText and f:facet footer and got the same behavior.

I also tried switching to PrimeFaces Extensions exporter and it finally included the footer in the PDF export but also some raw HTML from the table's columns that I don't know how to exclude (e.g. HTML used to display some font awesome icons...). I would prefer to continue using the Primefaces' dataExporter since it already exports the data correctly (only text) but make it export the footer as well.

Any ideas on how to make it work?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Alexandra
  • 103
  • 7
  • Are you sure you are using PrimeFaces 6.1. I tried to reproduce your problem, but I can't. Works with footerText and footer facet in PrimeFaces 6.1. You should also provide some code. – Alex Fire Mar 28 '18 at 06:32
  • 1
    Thanks for making me doubt it. I just tested using a very simple example and you are right, it does export it...but only when all columns have a footer. In my complicated case, not all columns have a footer so none gets exported. However, when using Primefaces Extensions' exporter, they do get exported, with empty cells for the ones that don't have footer. – Alexandra Mar 30 '18 at 07:12

1 Answers1

0

Recently I struggled to achieve footer facet columns in CSV export.

The solution was: Usage of

<p:column footerText="..."...

There are also attributes exportHeaderValue and exportFooterValue to override UI values in the export result.

This way the footer content showed up in the UI and via dataExporter in CSV and PDF.

Gunnar
  • 383
  • 4
  • 18