Response.Clear()
Response.Buffer = True
Response.Charset = "GB2312"
Response.AppendHeader("Content-Disposition", "attachment;filename=FileName.xls")
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")
Response.ContentType = "application/ms-excel"
Response.Write("<meta http-equiv=Content-Type content='text/html; charset=GB2312'>")
Me.EnableViewState = False
Dim myCItrad As New System.Globalization.CultureInfo("ZH-CN", True)
Dim oStringWriter As New System.IO.StringWriter(myCItrad)
Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)
DataGrid2.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()