专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > ASP.NET

GeidView打印报表,有列不打印有关问题

发布时间:2011-06-22 17:14:20 文章来源:www.iduyao.cn 采编人员:星星草
GeidView打印报表,有列不打印问题,在线等
gridview 的列有:姓名列,性别列,详细列,删除列
在查看gridview数据是 需要显示 【详细列,删除列】 但是,打印出来的报表中确不需要【详细列,删除列】
我的打印代码如下,求指教:
  Response.Clear();
  Response.Buffer = false;
  Response.Charset = "utf-8";
  Response.AppendHeader("Content-Disposition", "attachment;filename=recordWork.xls");
  Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
  Response.ContentType = "application/ms-excel";
  Response.Write("<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">");
  this.EnableViewState = false;
  System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
  HtmlTextWriter oHtmlTextWriter = new HtmlTextWriter(oStringWriter);
  GridView1.RenderControl(oHtmlTextWriter);  
  Response.Write(oStringWriter.ToString());
  Response.End();


------解决方案--------------------
在GridView1.RenderControl之前,绑定事件里面进行隐藏。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: