You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by bretto <de...@dr.com> on 2004/06/27 07:47:19 UTC

Using HSSF & Struts & prompting for file location?

Have been trying to work out how to let a user select the location  of the XLS 
file I am creating within my STRUTS project.  Struts does not support a File 
Save As button and I cannot seem to find a good Java Script Example.  Some one 
at work suggest there is a way of having the browser generate a file save as 
box from the action class by setting something in the response or similar.

Any thoughts?


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Using HSSF & Struts & prompting for file location?

Posted by Danny Mui <da...@muibros.com>.
response.reset();
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + 
fileName + "; ");

<....generate workbook.....>


There ya go =D

bretto wrote:

> Have been trying to work out how to let a user select the location  of the XLS 
> file I am creating within my STRUTS project.  Struts does not support a File 
> Save As button and I cannot seem to find a good Java Script Example.  Some one 
> at work suggest there is a way of having the browser generate a file save as 
> box from the action class by setting something in the response or similar.
> 
> Any thoughts?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org