zoukankan      html  css  js  c++  java
  • 多个GRIDVIEW同时导入到一个EXCEL文件中

    HttpContext.Current.Response.Clear();
            Response.Buffer = false;
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF7;
            HttpContext.Current.Response.ContentType = "application/ms-excel";
            HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=11.xls");
            System.IO.StringWriter tw = new System.IO.StringWriter();
            HtmlTextWriter hw = new HtmlTextWriter(tw);
            GVsystemzhuangbei.Columns[4].Visible = false;
            GVsystemzhuangbei.Columns[5].Visible = false;
            GVsystemzhuangbei.RenderControl(hw);

            GVsystemzhuangzhi.Columns[6].Visible = false;
            GVsystemzhuangzhi.Columns[7].Visible = false;
            GVsystemzhuangzhi.RenderControl(hw);

            GVzhongxinzhan.Columns[5].Visible = false;
            GVzhongxinzhan.Columns[6].Visible = false;
            GVzhongxinzhan.RenderControl(hw);

    GVchuanganqi.Columns[7].Visible = false;
            GVchuanganqi.Columns[8].Visible = false;
            GVchuanganqi.RenderControl(hw);
            HttpContext.Current.Response.Write(tw.ToString());
            HttpContext.Current.Response.End();

  • 相关阅读:
    面向对象进阶----->反射 getattr 和hasattr方法
    封装和 property方法
    C/S与B/S区别
    BIO、NIO和AIO
    ArrayList、Vector、LinkedList的区别
    AOP代理模式
    Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实 现)interface(接口
    Spring常见面试题及答案解析
    数据库优化
    事物的理解
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1420548.html
Copyright © 2011-2022 走看看