A
Amirallia
Hello
Here is my code to export a datagrid to Excel, it's work but the no
ASCII caracter are not correctly exported (for example : caracter "é"
)
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition",
"attachment;filename=Final.xls")
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = "UTF-8"
Dim monStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim monHtmlTextWriter As HtmlTextWriter = New
HtmlTextWriter(monStringWriter)
Me.dg1.RenderControl(monHtmlTextWriter)
Response.Write(monStringWriter.ToString())
Response.End()
Any idea to export correctly ?
Here is my code to export a datagrid to Excel, it's work but the no
ASCII caracter are not correctly exported (for example : caracter "é"
)
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition",
"attachment;filename=Final.xls")
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = "UTF-8"
Dim monStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim monHtmlTextWriter As HtmlTextWriter = New
HtmlTextWriter(monStringWriter)
Me.dg1.RenderControl(monHtmlTextWriter)
Response.Write(monStringWriter.ToString())
Response.End()
Any idea to export correctly ?