可以参考gridview的导出excel吧,网上有
解决方案 »
- 使用正则表达式替换掉所有的空格,除了日期格式中的
- 怎么用datagridview读取xml文件的内容
- 如何拆分一个byte数组?
- C#文件传输,客户端下载的文件怎么都是BMP格式??请问是哪里的问题,我想传.dat文件
- TreeNode
- 在c#中"abc"算是对象吗?
- winform界面问题,高分求解
- 用 C# 怎么 调用 数据库里的东西 SQL
- 急!跪求大神。(winform)datagrid 不进入编辑状态
- 简单问题:如何用程序根据一个控件的tabindex而将焦点定义到该控件
- XP下安装了IIS,也设置了虚拟站点,但是在浏览时却没有显示效果!各位大虾支招啊,急!
- 最近准备辞职,烦请告诉以下辞职的流程及注意事项
{
HttpContext.Current.Response.Charset ="UTF-8";
HttpContext.Current.Response.ContentEncoding =System.Text.Encoding.Default;
HttpContext.Current.Response.ContentType ="application/ms-excel";
HttpContext.Current.Response.AppendHeader("Content-Disposition","attachment;filename="+""+FileName+".xls");
ctl.Page.EnableViewState =false;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
ctl.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
}
ToExcel(DataGrid1,"dgExcel");