aspose file tools
The moose likes JSF and the fly likes Export to Excel in JSF -An Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Export to Excel in JSF -An Issue" Watch "Export to Excel in JSF -An Issue" New topic
Author

Export to Excel in JSF -An Issue

Vijay aRaghavan
Greenhorn

Joined: Jul 17, 2007
Posts: 7
Hi, I am trying to implement this feature and I've developed my app using Java Studio Creator.

1) Scenario and Issue:

Page1.jsp/Page1.java ---> I've created a Export to Excel link and I am navigating it to another JSF(Exceldisp.jsp/Exceldisp.java) with table columns mapped thats supposed to deliver the table present in Page1(JSF) in an Excel format

I use a alot many filter components and a submit button in the Page1.jsf apart from the [Export to Excel] link


Basically these four lines of code are added in my Exceldisp JSF.

res = (HttpServletResponse)getExternalContext().getResponse();

res.setContentType("application/vnd.ms-excel");
res.setHeader("Content-Disposition", "attachment; filename=Report.xls");
res.setHeader("Pragma","no-cache");

Issue:

After I display some report in the browser from Page1.jsf and click Export to Excel and download the report in a excel format a problem arises..

When I click my submit button again - a file dialog box opens and once again
I am receiving the next report in the excel format- for a submit action

Even when I change the filter parameters and try clicking the submit button of page 1 its happenning again.

I explicity tried to change the response paramters of Page1.jsp back to application/url-from encoded.. yadda yadda still no luck.

Is this an issue with the browser or any way can I avoid that
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Export to Excel in JSF -An Issue
 
Similar Threads
Generate PDF report from jsp
Inter portlet communication
I have to convert the HTML out put to excel file using jsp
Exporting HTML-Table data to EXCEL sheet
getting junk characters inside the excel sheet created from servlet