I export the data table to CSV format, for example:
"COL1","COL2","COL3"
"1","some text", "£232.00"
"2","some more text", "£111.00"
"3","other text", "£2.00"
The export code is pretty simple using the ashx handler:
context.Response.Clear()
context.Response.ContentType = "text/csv"
context.Response.AddHeader("Content-disposition", "attachment;filename=data.csv")
context.Response.AddHeader("Cache-Control", "must-revalidate")
context.Response.AddHeader("Pragma", "must-revalidate")
context.Response.Write(data)
context.Response.Flush()
context.Response.End()
My problem is when Excel tries to open the exported file, the character Âappears in front of all the characters £, for example. £232.00when the value should be £232.00.
source
share