我如何下载显示在gridview中的数据? [英] how can i downlaod data which show in gridview?
本文介绍了我如何下载显示在gridview中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
我想对我在gridview中显示的数据不满意,有人可以指导我吗?
Hello friends,
i want to downlaod the data which show in my gridview can any one guide me??
string attachment = "attachment; filename=rates.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter stw = new StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
GridView1.RenderControl(htextw);
Response.Write(stw.ToString());
Response.End();
我正在使用此代码进行下载按钮,但是此代码仅下载当前页面,这意味着我们在gridview中有3个页面,此代码仅下载在gridview上显示的页面.帮帮我的朋友
i am using this code for download button but this code download only the current page means we have 3 page in gridview this code download only that page which is show on gridview. help me friends
推荐答案
请访问以下链接
将GridView导出到Excel [ ASP.Net 2.0:将GridView导出到Excel [
Please visit following links
Export GridView to Excel[^]
ASP.Net 2.0: Export GridView to Excel[^]
:)
这篇关于我如何下载显示在gridview中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文