zoukankan      html  css  js  c++  java
  • 导出excel

    1.导出html语句
           public void OutExcel(object sender, EventArgs e)
            {
                var tbHtml = thtml.Value;
                System.Web.HttpContext.Current.Response.Charset = "UTF-8";
                System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
                System.Web.HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("OA.xls", System.Text.Encoding.UTF8).ToString());
                System.Web.HttpContext.Current.Response.ContentType = "application/ms-excel";
                System.IO.StringWriter tw = new System.IO.StringWriter();
                System.Web.HttpContext.Current.Response.Output.Write(tbHtml);
                System.Web.HttpContext.Current.Response.Flush();
                System.Web.HttpContext.Current.Response.End();
            }

  • 相关阅读:
    1221D
    1249E
    D. Yet Another Monster Killing Problem
    大佬传送门
    Zookeeper客户端连接报错
    搭建PXC集群
    Docker分布式环境
    Docker使用
    Docker入门
    MySQL数据库集群概述
  • 原文地址:https://www.cnblogs.com/change4now/p/5665215.html
Copyright © 2011-2022 走看看