Response.Clear() Response.buffer
=
true
Response.ContentType = " application/vnd.ms-excel;utf-8 "
Response.ContentEncoding = System.Text.Encoding.GetEncoding( " GB2312 " )
' Response.Charset = "utf-8"
Response.ContentType = " application/vnd.ms-excel;utf-8 "
Response.ContentEncoding = System.Text.Encoding.GetEncoding( " GB2312 " )
' Response.Charset = "utf-8"
If
Instr
(
1
, Request.ServerVariables(
"
HTTP_USER_AGENT
"
),
"
MSIE 4.01
"
)
>
0 t
hen
Response.AddHeader( " Content-Disposition " , " inline;filename= " + DateTime.Now.Tostring( " yyyy-MM-dd " ) + " .xls " )
Else
Response.AddHeader( " Content-Disposition " , " attachment;filename= " + DateTime.Now.Tostring( " yyyy-MM-dd " ) + " .xls " )
End
If
Response.AddHeader( " Content-Disposition " , " inline;filename= " + DateTime.Now.Tostring( " yyyy-MM-dd " ) + " .xls " )
Else
Response.AddHeader( " Content-Disposition " , " attachment;filename= " + DateTime.Now.Tostring( " yyyy-MM-dd " ) + " .xls " )