DataGrid数据在Execel中打开public void ToExcel(System.Web.UI.Control ctl)  
        }
调用

ToExecel(DataGridName);



DataGrid数据在Execel中打开HttpContext.Current.Response.ContentType ="application/ms-excel";
DataGrid数据在Execel中打开HttpContext.Current.Response.AppendHeader(
"Content-Disposition","attachment;filename="+""+FileName+".xls");
DataGrid数据在Execel中打开System.IO.StringWriter  tw 
= new System.IO.StringWriter();
DataGrid数据在Execel中打开System.Web.UI.HtmlTextWriter hw 
= new System.Web.UI.HtmlTextWriter(tw);
DataGrid数据在Execel中打开
this.DataGrid1.RenderControl(hw);
DataGrid数据在Execel中打开HttpContext.Current.Response.Write(tw.ToString());
DataGrid数据在Execel中打开HttpContext.Current.Response.End();

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
猜你喜欢
  • 2022-02-02
  • 2022-12-23
  • 2022-02-20
  • 2022-12-23
  • 2022-02-07
  • 2022-02-14
  • 2021-08-12
相关资源
相似解决方案