gridview 导出excel (支持excel2007)
来源:互联网 发布:python jupyter 编辑:程序博客网 时间:2024/06/05 04:17
private void Export(GridView _gv, string FileName)
{
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=GB2312>");
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());//FileName.xls");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.ContentType = "application/vnd.xls";//设置输出文件类型为excel文件。
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
_gv.RenderControl(oHtmlTextWriter);
Response.Output.Write(oStringWriter.ToString());
Response.Flush();
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
}
- gridview 导出excel (支持excel2007)
- gridview 导出excel (支持excel2007)
- gridview导出到EXCEL2007
- gridview 导出excel2007
- Poi方式解析Excel文件(支持Excel2007)
- Poi方式解析Excel文件(支持Excel2007)
- GridView导出Excel研究
- GridView导出Excel研究
- GridView导出Excel研究
- GridView导出Excel
- GridView格式化导出Excel
- GridView导出Excel研究
- GridView导出到Excel
- GridView导出Excel研究
- GridView导出Excel研究
- GridView导出Excel研究
- GridView导出Excel研究
- gridview导出Excel
- 永远的魔兽
- 增加区段的VC嵌汇编代码
- 学编程中的科学与迷信
- C# Using用法三则
- 正则表达式30分钟入门
- gridview 导出excel (支持excel2007)
- 关于"从不是创建控件的线程访问它”
- SAP-HR学习
- Plate Tectonics(terms explanation)
- infile.getline() infile.get() 出现的问题,还没有解决.换成 getline(infile,str) 就正常了。所以用高级类型更安全,以后应该用高级类型string等
- 常用正则表达式
- wlan无线ap的几个知识
- CodeFile 与 CodeBehind 的区别
- 软件保护壳技术专题 - 反调试器技术