I have written a function to export the grid data into excel. When the grid has around 1600 rows, the export function is producing 0byte file. But when the rows are less in numbers, it works fine. My export code is below. I am not getting how/what to debug!! Is this because of Response stream size? Could some one please show me a way, how to proceed with this problem. \[code\] Response.Clear(); Response.AddHeader("content-disposition", "attachment; filename=" + "FileName" + ".xls"); Response.Charset = ""; 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); grdMain.RenderControl(htmlWrite); Response.Write(stringWrite.ToString()); Response.End();\[/code\]