Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Export to Excel using Poi jar in JSF

 
rupali singh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18164
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Yair Ivan
Greenhorn
Posts: 15
Eclipse IDE Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example, you need in backingbean:




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

Bye.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic