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

  • 相关阅读:
    CF1450H2
    CF1379F2
    CF1217F
    CF1393E2
    CF1510H
    CF1514E
    CF1515G
    CF1516E
    在pycharm中导入PyMysql出错,解决方法
    搭建fastdfs文件服务器
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1420548.html
Copyright © 2011-2022 走看看