我想在单个excel文件中导出所有绑定转发器数据。
使用此代码只有转发器的第一页正在导出,但我想要整个转发器数据。
这是我的C#代码:
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=Detail.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
rptrdata.RenderControl(htmlWrite);
Response.Write("<table>");
Response.Write(stringWrite.ToString());
Response.Write("</table>");
Response.End();
答案 0 :(得分:0)
确保在转发器中绑定的记录具有所有页面值或当前页面值。