zoukankan      html  css  js  c++  java
  • ASP.net 导出Excel数据攻略

    方法1.通过DateSet

    把DataSet内的数据,接每行/n结束,每行中的数据项/t分隔写入Response流,然后设置Content-Disposition.封装好的函数,如下:只需传入DataSet即可.

    Code

    方法2:通过DataGrid

    核心代码为:

      System.IO.StringWriter    stringWriter = new System.IO.StringWriter() ;
         System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter (stringWriter);
         this.DataGrid1.RenderControl(hw);
         HttpContext.Current.Response.Write(tw.ToString());
         HttpContext.Current.Response.End();

  • 相关阅读:
    zookeeper使用场景
    zookeeper安装配置
    hadoop 远程调试
    deep learning笔记
    Sentiment Analysis(1)-Dependency Tree-based Sentiment Classification using CRFs with Hidden Variables
    PRML阅读笔记 introduction
    Python 学习笔记(2)
    python nltk 学习笔记(5) Learning to Classify Text
    python nltk 学习笔记(4) Writing Structured Programs
    python nltk 学习笔记(3) processing raw text
  • 原文地址:https://www.cnblogs.com/CUCmehp/p/1321575.html
Copyright © 2011-2022 走看看