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();

  • 相关阅读:
    SQL 开窗函数
    使用 git 管理源代码
    mybatis常见问题
    es-删除记录
    Jmeter使用
    websocket在服务端获取客户端IP
    单点登录
    java中的HTTP客户端
    SpringBoot利用Redis管理分布式Session
    springboot中的统一异常处理
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1420548.html
Copyright © 2011-2022 走看看