Author: genuine.forever | Posted on: 1/18/2010 4:52:54 AM | Views : 303



can u help me i have some problem for Grid . i have someecords in grid i want ot export in excel file . i use code like below Response.Clear(); // Response.AddHeader("content-disposition", "attachment;filename=FileName.xls"); // Response.Charset = ""; // // If you want the option to open the Excel file without saving than // // comment out the line below // // Response.Cache.SetCacheability(HttpCacheability.NoCache); // Response.ContentType = "application/vnd.xls"; // System.IO.StringWriter stringWrite = new System.IO.StringWriter(); // System.Web.UI.HtmlTextWriter htmlWrite =new HtmlTextWriter(stringWrite); // grdMembers.RenderControl(htmlWrite); // Response.Write(stringWrite.ToString()); // File.WriteAllText("C:\\Pulsus_ERP\\GiftVoucher\\new.xls", stringWrite.ToString()); on use this code on butto ...

Go to the complete details ...