-
这是我现在用的方法
/// 导出方法 /// </summary> /// <param name="GridView"></param> /// <param name="filename">保存的文件名称</param> private void ExportGridViewForUTF8(GridView GridView, string filename) { string attachment = "attachment; filename=" + filename; Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", attachment); Response.Charset = "UTF-8"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); Response.ContentType = "application/ms-excel"; System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); GridView.RenderControl(htw); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); }
这是我用这个方法实现的效果
现在我想让他把后面分页的5224条数据,全显示在一个Excel表里
应该怎么写啊 大佬们
*
已采纳
asp.net gridview 导出Excel 分页???
- 写回答
- 好问题 提建议
- 追加酬金
- 关注问题
- 分享
- 邀请回答