• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Export xlsx file in JSF 2 / Icefaces 3 application

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I try to export data in an xlsx file in my JSF 2 / Icefaces 3 application. For this i create a workbook, init rows and cells and write it in the outputstream of the response but i have no result. Only a hourglass. I have ajax call in my page but not on the export button.

In the Firebug when i look the response i have data.

Action in ManagedBean :




button



pom.xml




Request in Firebug :



Response in Firebug :



 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I strongly discourage making JSF code output non-HTML content such as PDF, XLS, or Word DOC formats. Do that part of your webapp using a regular servlet or JSP(X).

The FacesServlet invests a lot of effort into conditioning its output stream to be JSF-friendly HTML and this complicates code that doesn't want to output JSF-friendly HTML.
 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the solution, the problem is that you can not download a file with Ajax. It must be disable like this for Icefaces :

 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is true, but I still don't recommend generation of non-HTML content using JSF. JSF doesn't mind if you use a servlet or JSPX prototype to create XLSX.
reply
    Bookmark Topic Watch Topic
  • New Topic