asp.net 控件 导出 excel
//导出EXCEL
protected void btnDaoChu_Click(object sender, EventArgs e)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("XXX表") + new Random().Next() + ".xls");
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;
HttpContext.Current.Response.ContentType = "application/ms-excel";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
GridView1.AllowPaging = false;
BindGrd();
GridView1.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
GridView1.AllowPaging = true;
BindGrd();
}
public override void VerifyRenderingInServerForm(Control control)
{
// Confirms that an HtmlForm control is rendered for
}
asp.net 控件 导出 excel的更多相关文章
- datagridview控件--导出Excel
dataGridView控件可以说很方便的显示了数据,而且对于修改和删除数据也很方便,我在前面的一篇博客中写到了如何去绑定数据到该控件上dataGridView控件--绑定数据方法,今天我将如何将数据 ...
- 基于C#语言MVC框架NPOI控件导出Excel表数据
控件bin文件下载地址:https://download.csdn.net/download/u012949335/10610726@{ ViewBag.Title = "dcxx" ...
- 基于C#语言MVC框架Aspose.Cells控件导出Excel表数据
控件bin文件下载地址:https://download.csdn.net/download/u012949335/10610726 @{ ViewBag.Title = "xx" ...
- C# winform平台下使用spread控件导出excel表格
//首先要引入两个控件:1.根据自己的office 版本在项目->添加引用->microsoft office object 12.0 library (2010版) //2.在.net中 ...
- webform 不实用office控件导出excel StringBuilder 类型拼接字符串表格导出excel
StringBuilder sb = new StringBuilder(); sb.AppendLine("<meta http-equiv=\"Content-Type\ ...
- 使用Aspose.Cell控件实现Excel高难度报表的生成(三)
在之前几篇文章中,介绍了关于Apsose.cell这个强大的Excel操作控件的使用,相关文章如下: 使用Aspose.Cell控件实现Excel高难度报表的生成(一) 使用Aspose.Cell控件 ...
- 任意flex控件导出图片
任意flex控件导出图片 flex导出图片功能通常是: 思路1:客户端将UIComponent转化为BitmapData,再转为ByteArray,将ByteArray上传到服务端,服务端发送文件 ...
- ASP.NET Core 导入导出Excel xlsx 文件
ASP.NET Core 使用EPPlus.Core导入导出Excel xlsx 文件,EPPlus.Core支持Excel 2007/2010 xlsx文件导入导出,可以运行在Windows, Li ...
- asp.net <asp:Content>控件
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_MainContent" runat=" ...
随机推荐
- Java的面向对象思想
多态性: 一种方法有多种实现,采用哪一种实现由Java虚拟机在运行时动态决定,这种能力成为动态绑定(dynamic binding),也称为多态性(polymorphism)(源于一个希腊单词,意为“ ...
- hadoop 2.0 详细配置教程
http://www.cnblogs.com/scotoma/archive/2012/09/18/2689902.html
- java System 常用方法
一.System.currentTimeMillis() 获取系统当前时间,毫秒 二.System.getProperty Java.version Java 运行时环境版本 java.vendor ...
- ORA-12154 TNS无法解析指定的连接标识符
又是这个百无聊赖的问题,尽管问题芝麻点大,却让我们好找啊! 非常久没有安装oracle了.今天安装11g的时候,用PLSQL Developer连接时,就出现了这个俗不可耐的问题:ORA-12154 ...
- 简单详细的OD破解教程
2007-08-04 15:46作者:CCDebuger注:昨天在网上见到了这篇文章,但缺少插图,从另外一篇文章中也看到了类似的的教程文章,里面的插图质量实在不敢恭维.在一个论坛中正好下载了文章中所介 ...
- HOG特征-理解篇
网上去找关于HOG的资料,发现理解性的较少,并且较为冗长,为方便大家理解便自己写了篇,希望能对奋斗在特征提取第一线的同志们有所帮助: HOG即histogram of oriented gradien ...
- Android GridView 添加 网格线解决办法
在使用 GridView 网格布局时,默认情况下 GridView 是没有网格线的,但是有些时候我们需要让GridView显示分割线,怎么办呢?查了不少资料,找到了一种为GridView添加网格线的 ...
- python 源码解析
http://blog.donews.com/lemur/archive/category/cpython%E6%BA%90%E7%A0%81%E5%89%96%E6%9E%90/
- VS2005工程迁移到Eclipse CDT
原工程在VS2005下创建,后迁移到Eclipse CDT 3.3.2 + MingGW下,并增加makefile文件. 原VS2005下工程Sample,实现了对类SampleClass封装,生成S ...
- A XSS filter for Java EE web apps--转载
原文地址:http://java.dzone.com/articles/xss-filter-java-ee-web-apps Cross Site Scripting, or XSS, is a f ...