ASP.NET中打印出excel表格时,没有网格 我在。net中加个了把数据打印到excel中!可是在excle中显示不出网格?不知道问题出在哪? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 下面是我的代码,请指教 protected void excel_Click(object sender, EventArgs e) { if (gvUserList.Rows.Count != 0) Export("application/ms-xls", "公寓楼信息.xls"); } private void Export(String FileType, String FileName) { Response.Charset = "GB2312"; Response.ContentEncoding = Encoding.UTF7; Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString()); Response.ContentType = FileType; this.EnableViewState = false; StringWriter tw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(tw); gvUserList.AllowPaging = false; BindGridView(); gvUserList.RenderControl(hw); Response.Write(tw.ToString()); Response.End(); gvUserList.AllowPaging = true; BindGridView(); } public override void VerifyRenderingInServerForm(Control control) { } FCKEditor的上传文件路径问题(在线等) 怎么在Datalist中用checkbox删除多行数据?急 能弹出这两种对话柜吗? 请问什么是强类型?什么是弱类型? 什么是显式转换?什么是隐式转换 问一个比较菜的问题! 关于mydatepicker97控件的问题 上传问题,未将对象引用设置到对象的实例! ASP.NET的例子的书 问题很奇怪 高手进来看 一句Vb.net代码怎样转换成C#代码?急!!!!! 在同一页面设置两个不同时长的Session要怎么实现 各位登录是如何实现的?是不是都是无刷新登录?
{
if (gvUserList.Rows.Count != 0)
Export("application/ms-xls", "公寓楼信息.xls");
} private void Export(String FileType, String FileName)
{
Response.Charset = "GB2312";
Response.ContentEncoding = Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());
Response.ContentType = FileType;
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
gvUserList.AllowPaging = false;
BindGridView();
gvUserList.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
gvUserList.AllowPaging = true;
BindGridView();
} public override void VerifyRenderingInServerForm(Control control)
{ }