グリッドデータをExcelにエクスポートする関数を作成しました。グリッドに約1600行ある場合、エクスポート機能は0バイトのファイルを生成します。ただし、行の数が少ない場合は正常に機能します。私のエクスポートコードは以下の通りです。デバッグの方法/内容がわかりません!! これは応答ストリームのサイズが原因ですか?誰かが私にこの問題を進める方法を教えてくれませんか。
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();