本文介绍了从一个GridView不同的Excel工作表中导出数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是从一个数据集将数据绑定到一个网格和从网格数据导出到excel.if在网格物品的数量大于50000,则显示错误消息。
I am binding data from a dataset to a grid and exporting data from the grid to an excel.if the the number of items in the grid is greater than 50000,an error message is displayed.
所以我想将数据拆分,并在Excel工作表中的不同显示它。(我在一个Web应用程序的工作)
So i want to split the data and display it in different worksheets in excel.(Am working in a web application)
使用此$ C $下导出到Excel
using this code for exporting to excel
gvExcel.DataSource = DTS;
gvExcel.DataBind();
Response.AddHeader("content-disposition", "attachment; filename= filename.xls");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvExcel.RenderControl(htw);
// Style is added dynamically
Response.Write(style);
Response.Write(sw.ToString());
Response.End();
谁能帮我这个?
Can anyone help me on this??
推荐答案
以下链接这样做将是有益的。
Following links will be useful to do so..
HTTP://www.$c$cproject.com/KB/办公/ ExportDataSetToExcel.aspx
http://www.c-sharpcorner.com/blogs/ BlogDetail.aspx?BlogId = 283
希望这将帮助!
这篇关于从一个GridView不同的Excel工作表中导出数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!