I'm exporting the contents of a GridView (in C# v2) into Excel.
However, whilst the GridView displays on the web page correctly, when
the data is in Excel, I get a lot of  characters appearing ('A' with
a hat on top) where there are numbers (ie; order numbers and line
totals).
Is there an easy way to remove these?
The code I'm using looks like:
<code>
protected void btn_export_Clic k(object sender, EventArgs e)
{
Response.Clear( );
String fileName = Invoice";
Response.AddHea der("content-disposition",
string.Format(" attachment;file name={0}.xls", fileName));
Response.Charse t = "";
Response.Conten tType = "applicatio n/vnd.xls";
Response.Write( sb.ToString());
Response.Write( Session["ExcelDataG rid"].ToString());
Response.End();
}
</code>
and I've got
<code>
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
culture="en-GB"/>
</code
in my web.config file.
However, whilst the GridView displays on the web page correctly, when
the data is in Excel, I get a lot of  characters appearing ('A' with
a hat on top) where there are numbers (ie; order numbers and line
totals).
Is there an easy way to remove these?
The code I'm using looks like:
<code>
protected void btn_export_Clic k(object sender, EventArgs e)
{
Response.Clear( );
String fileName = Invoice";
Response.AddHea der("content-disposition",
string.Format(" attachment;file name={0}.xls", fileName));
Response.Charse t = "";
Response.Conten tType = "applicatio n/vnd.xls";
Response.Write( sb.ToString());
Response.Write( Session["ExcelDataG rid"].ToString());
Response.End();
}
</code>
and I've got
<code>
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
culture="en-GB"/>
</code
in my web.config file.
Comment