How to export data to excel/pdf?

UI Components for JSF
Post Reply
dbermudez
Posts: 5
Joined: 08 Sep 2011, 20:55

19 Oct 2011, 15:57

Hello, I am using the dataExporter control, just like in the showcase demo, but when I try to export data into Excel, I get the following errors:

an exception of classNotFound exception org.apache.poi.hssf.usermodel.HSSFWorkbook for excel. The demo does not say anything about having to install packages or JAR files. Do I need to include packages, JAR files or do something in particular for the dataExporter to work properly?
dbermudez
JSF 2.0
Primefaces 2.2.1
Netbeans 7.0

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Oct 2011, 16:00

You need poi, see user's guide.

dbermudez
Posts: 5
Joined: 08 Sep 2011, 20:55

19 Oct 2011, 16:36

Ok I downloaded the POI library version 3.7 files and there are several JAR files.

poi-3.7-20101029
poi-ooxml-3.7-20101029
poi-scratchpad-3.7-20101029

in the root of the downloaded folder. But there are more JAR files within a lib folder. Do I need to include all of the JAR files or which ones do I need?
dbermudez
JSF 2.0
Primefaces 2.2.1
Netbeans 7.0

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Oct 2011, 16:41

Page 12, user's guide.

dbermudez
Posts: 5
Joined: 08 Sep 2011, 20:55

19 Oct 2011, 17:10

Got the correct versions this time. Thank you for the heads-up. I am getting OutOfMemory Exceptions from weblogic server now but I don't think it's from adding these libraries.
dbermudez
JSF 2.0
Primefaces 2.2.1
Netbeans 7.0

dbermudez
Posts: 5
Joined: 08 Sep 2011, 20:55

19 Oct 2011, 17:16

Ok managed to restart weblogic server and the exporting now works. Thanks again.
dbermudez
JSF 2.0
Primefaces 2.2.1
Netbeans 7.0

User avatar
bercolax
Posts: 133
Joined: 02 Aug 2009, 13:27
Location: Courtallam, India
Contact:

19 Oct 2011, 17:20

Just for the benefit for Maven users the dependencies are provided below (which work with PrimeFaces v 3.0 M4 SNAPSHOT).

itext is needed only if you need PDF export

Code: Select all

         <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>
          </dependency>
PrimeFaces 3.4, Seam Faces 3.0.2.Final, Glassfish v3.1, Mojarra 2.1.10, NetBeans 7.2, Hibernate JPA 2.0, Seam Persistence 3.0.0.Final Theme default HOT-SNEAKS

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Oct 2011, 17:24

For 2.x users, poi version is 3.2.

Marie123
Posts: 1
Joined: 03 May 2018, 16:53

03 May 2018, 16:55

Hi!
I understand that maybe my answer to you may not help with this question, but in the future it will be useful https://www.altopdf.com/ for working with files online

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests