O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exporting data into PDF/XLS/XML/CSV formats using the DataExporter component

The DataExporter component provides the ability to export the DataTable data into various formats such as Excel, PDF, CSV, and XML. DataExporter provides options for:

  • Exporting entire DataTable rows
  • Exporting only current page rows
  • Exporting only selected rows
  • Excluding particular columns
  • Customizing exporting data using pre- and post-processors

To export data into PDF and Excel formats, we need itext.jar and apache-poi.jar respectively to be added to the classpath:

<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.7</version> </dependency> <dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>2.1.7</version> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required