Repeater导出Excel如何 让Excel适应内容改变宽度固定 也行 求教
解决方案 »
- 求qq在线客服代码
- 正在写HTML模板标签处理 给点思路
- net问题Items[i].Cells[0].Controls[1] as CheckBox
- 求救...高手们请进~~
- var isIE = (document.all) ? true : false; ie独有么?
- Cookie里的部份内容会莫名奇妙地丢失
- .net中的sql问题
- artdialog的确定取消对话框如何使用,传递返回值?
- 请问怎样把Window中的那个发邮件的打开啊用代码实现 急
- 再问一个参数问题
- 关于退出登录并清空Session
- int num = Convert.ToInt32(txtNum.Text.ToString().Trim());总是返回0x00000001
参考
http://blog.csdn.net/limeiyu/article/details/5676177
response.Clear();
response.AddHeader("content-disposition", string.Format("attachment; filename={0}.xls", HttpUtility.UrlEncode(Encoding.UTF8.GetBytes(fileName))));
response.ContentType = "application/vnd.ms-excel";
response.Charset = "GB2312";
response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); response.Write(string.Format(@"<html><head><meta http-equiv=Content-Type content=""text/html; charset=GB2312""><style>{0}</style><script type='text/javascript'>{1}</script></head><body>", GetStyleForTravelLine(), GetJavascriptForTravelLine(OrderNumber, OutString)));
response.Write(content);
response.Write("");
response.Write("</body></html>");
response.Flush();
try
{
response.End();
}
catch { }