File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Export to Excel using Poi jar in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Export to Excel using Poi jar in JSF" Watch "Export to Excel using Poi jar in JSF" New topic

Export to Excel using Poi jar in JSF

rupali singh

Joined: Jun 20, 2008
Posts: 9
Hi ,
I am working on Export to Excel using POI jars. i am using rich:dataTable for my table to export.I have wrapped it with <t:buffer>.In my table i have radio buttons as my 1st column, and also i am using sort for my header sorting.

The problem is when i export it to excel along with data my radio button are also getting exported and i can see a square icon on the header which is the sort icon.

i used substring to remove the radio buttonfrom the buffer variable as buffer variable contain HTML code. But nothing happened.

Please guide me. Below is the code of substring.

radioSubString = htmlBuffer .substring(htmlBuffer.indexOf("<input type=\"radio"),htmlBuffer.indexOf("<label ")); System.out.println("radioSubString--->" + radioSubString);
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

As a general rule, you shouldn't attempt to use a JSF View definition to output non-HTML data such as PDF's, MS-Word documents or Excel spreadsheets. The actual data output for those types of objects is much better done by servlets. You can use JSF to setup the data and to link to the servlet's URL, however.

An IDE is no substitute for an Intelligent Developer.
Yair Ivan

Joined: Jul 13, 2008
Posts: 15

For example, you need in backingbean:

where the Servlet "ExportExcelServlet" is management export to excel.


SCJP 6.0, SCBCD 5.0, SCDJWS 5.0
I agree. Here's the link:
subject: Export to Excel using Poi jar in JSF
It's not a secret anymore!