Response.Clear()
Response.Buffer = True
Response.Charset = "GB2312"
Dim st As Integer = DateDiff(DateInterval.WeekOfYear, CDate(Session("Weekreport").ToString.Substring(0, 4) + "/1/1"), Session("Weekreport")) + 1
Dim filename As String = "attachment;filename=WeekReportBM" + st.ToString + ".xls"
Response.AppendHeader("Content-Disposition", filename)
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312") '//设置输出流为简体中文
Response.ContentType = "application/ms-excel" '//设置输出文件类型为excel文件。
Me.EnableViewState = False
Dim myCItrad As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("ZH-CN", True)
Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter(myCItrad)
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)
Me.Panel1.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString)
Response.End()
posted on 2005-10-26 16:09
萌芽的叶子 阅读(255)
评论(0) 编辑 收藏 引用 所属分类:
datagrid