We're exporting some data from a website app into an Excel spreadsheet, however, when a GBP symbol is used, instead of outputting "£9.99" it produces "£9.99".
Here's the code a colleague has written to produce the spreadsheet [tableOut is a StringBuilder that contains an HTML table]:
string filename = "EngageReplies.xls";
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader( "content-disposition", "attachment;filename=" + filename );
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.EnableViewState = false;
Response.Write( tableOut );
Response.End();
Any ideas how we can get the desired output?
p.s. Not sure if I should separate this into a separate question, but when the spreadsheet is generated, a warning message is triggered:
The file you are trying to open, 'EngageReplies.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
I've used Firefox and IE to Open the file with Office 2007. Clicking Yes opens the file okay, but I would prefer it if my users weren't subjected to it.