Love-Hu

 以下的代码是将WEB窗体中显示的内容导出到WORD文档
 
   Response.Clear();
      Response.Buffer= true;
      Response.Charset="utf-8"; 

      Response.AppendHeader("Content-    Disposition","attachment;filename=FileFlow.doc");
      Response.ContentEncoding=System.Text.Encoding.GetEncoding("utf-8");  
      Response.ContentType = "application/ms-word";
      this.EnableViewState = false; 

      System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
      System.Web.UI.HtmlTextWriter oHtmlTextWriter = new   System.Web.UI.HtmlTextWriter(oStringWriter);  
     
      this.RenderControl(oHtmlTextWriter);   
      Response.Write(oStringWriter.ToString());
      Response.End(); 

分类:

技术点:

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2022-02-09
  • 2021-04-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-02-26
  • 2022-12-23
  • 2021-05-26
  • 2021-12-19
相关资源
相似解决方案