I am using store procedure for retriving data for both parent gridview as welll as child gridview,
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment;filename= = CustomerAging.xls");
Response.ContentEncoding = Encoding.UTF8;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
gridCustomeraging.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();

Priyanka JainRank #356 · 7K reputationPosted Sep 9, 2019, 4:33 AM EDT
Sonu GuptaRank #1,261 · 1.4K reputationPosted Sep 10, 2019, 7:20 PM EDT