Amit Jagtap

Amit Jagtap

  • NA
  • 8
  • 8.5k

How to export all repeater data in excel file

Aug 13 2015 5:58 AM
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)