You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Carl-Jakob <ca...@hotmail.com> on 2003/05/23 20:30:46 UTC

SV: Excel output problems my solution

A reset() of the response fixed the biggie



-----Ursprungligt meddelande-----
Från: Carl-Jakob [mailto:carljakob@hotmail.com] 
Skickat: den 23 maj 2003 16:28
Till: 'Struts Users Mailing List'
Ämne: SV: Excel output problems

I set the ContentType before i set the header....  even tried the
reversed.



-----Ursprungligt meddelande-----
Från: shirishchandra.sakhare@ubs.com
[mailto:shirishchandra.sakhare@ubs.com] 
Skickat: den 23 maj 2003 16:22
Till: struts-user@jakarta.apache.org
Ämne: RE: Excel output problems

Should the response.setContentType("application/vnd.ms-excel"); before u
set the header?

-----Original Message-----
From: Carl-Jakob [mailto:carljakob@hotmail.com]
Sent: Friday, May 23, 2003 4:20 PM
To: 'Struts Users Mailing List'
Subject: SV: Excel output problems


Thanks for the response =)
It doesn't work either

-----Ursprungligt meddelande-----
Från: shirishchandra.sakhare@ubs.com
[mailto:shirishchandra.sakhare@ubs.com] 
Skickat: den 23 maj 2003 16:17
Till: struts-user@jakarta.apache.org
Ämne: RE: Excel output problems

try

response.addHeader("Content-Disposition",
"attachment;filename=myfile.xls");

-----Original Message-----
From: Carl-Jakob [mailto:carljakob@hotmail.com]
Sent: Friday, May 23, 2003 4:07 PM
To: struts-user@jakarta.apache.org
Subject: Excel output problems


Hi
 
I have a Action thats generate a Excel spreedshet from a csvfile. I have
set the respone to
response.setHeader("Content-Disposition","inline;filename=myfile.xls");
response.setContentType("application/vnd.ms-excel");
 
the problem is that when the browser gets the response and i want to
save it, it tries to save the file as the url i posted.  like
?cvs=pricelist&content=hours.
 
 

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


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


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


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


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