Click here to Skip to main content
16,023,117 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am getting -2.303 in the code only but when I write response.end
it is not coming on the screen....Help me out..
Posted
Updated 24-Feb-10 8:48am
v2

1 solution

If you must use the response object ( which I guess you do if you're writing a binary file ), you should ALWAYS use response.End. If it's an Excel spreadsheet, it will show the data in the format you provided, assuming Excel is present. Perhaps if you posted some code and generally explained yourself, we could help more.
 
Share this answer
 
Comments
Gagandhiman 17-Aug-10 11:41am    
Hi Graus...

Thanks for reply. Code that i m using for excel 2003 and 2010 is listed below

Response.ClearHeaders()
Response.ContentEncoding = Encoding.GetEncoding("Windows-1252")
Response.Charset = ""
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ' '' for excel 2010

Response.ContentType ="application/vnd.ms-winword" '' for excel 2003



Response.AddHeader("content-disposition", "attachment; filename=RiskRatingExport.xlsx")


issue is that i m generating an repeater which is in table format and when open the repeater as excel by using code listed above for 2003 working fine and for 2010 excel it is showing incorect format of data.

Do I need to do something else.

Please reply it is urgent.

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900