C#导出EXCEL方法总结

来源:互联网 发布:淘宝网魏宁海天地人 编辑:程序博客网 时间:2024/05/17 03:18

下面介绍下我根据网上学习C#中导出EXCEL的几种方法:

一、asp.net导出Excel

1.将整个html全部输出到Excel

此方法会将html中所有的内容,如按钮、表格、图片等全部输出

1  Response.Clear();     2     Response.Buffer=   true;     3     Response.AppendHeader("Content-Disposition","attachment;filename="+DateTime.Now.ToString("yyyyMMdd")+".xls");           4     Response.ContentEncoding=System.Text.Encoding.UTF8;   5     Response.ContentType   =   "application/vnd.ms-excel";   6     this.EnableViewState   =   false;  


 

原创粉丝点击