*
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
Author

Export to Excel using Poi jar in JSF

rupali singh
Greenhorn

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: 16061
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Yair Ivan
Greenhorn

Joined: Jul 13, 2008
Posts: 15

For example, you need in backingbean:




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

Bye.

SCJP 6.0, SCBCD 5.0, SCDJWS 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Export to Excel using Poi jar in JSF