6
Reply

How to export all repeater data in excel file

Amit Jagtap

Amit Jagtap

Aug 13 2015 5:58 AM
1.9k
I want to export all repeater data into excel file.  I used this code but I got only one page data so I want  to get all records (all pages).please help me.
 
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();
 

Answers (6)