Hi,
you don't have to generate csv-files take the html-Code itself,
and change the mime type to "application/vnd.ms-excel".
This should work too.
Manfred

> -----Original Message-----
> From: Jim Crossley [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 02, 2002 4:34 PM
> To: Struts Users Mailing List
> Subject: Re: How to Generate .xls file from struts app.
> 
> 
> "gvn" <[EMAIL PROTECTED]> writes:
> >
> > I would like to generate a .xls (excel) file data from a result set.
> > =20
> > What I have to do ?=20
> 
> One simple approach is to generate a CSV (Comma-Separated-Values) file
> instead, and then set the response's content type to
> "application/vnd.ms-excel".  That way, you exploit the fact that Excel
> transparently handles CSV files and rely on the browser to invoke
> Excel. 
> 
> Your action amounts to something not quite as trivial as this:
> 
>   PrintWriter out = response.getWriter();
>   while (youHaveRows)
>     while (youHaveColumns)
>       out.print(yourCell+",");
>   out.close();
>   response.setContentType("application/vnd.ms-excel");
> 
> -- 
> Jim Crossley
> http://www.lads.com/~jim
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to