![]() StreamReader sr = new StreamReader(s, Encoding.Unicode) īyte byteArray = (sw.ToString()) MemoryStream s = new MemoryStream(byteArray) ![]() Open a memory stream that you can use to write back to the response HtmlTextWriter htw = new HtmlTextWriter(sw) Convert the rendering of the gridview to a string representation HttpContext curContext = HttpContext.Current Ĭ("content-disposition", "attachment filename=" + fileName) Ĭ(HttpCacheability.NoCache) Ĭ = "application/vnd.ms-excel" Create a response stream to create and write the Excel file Public override void ExecuteResult(ControllerContext context) Public ExcelFileResult(GridView gv, string pFileName) Public class ExcelFileResult : ActionResult Is the code i am using have some problem?ĮxcelFileResult.cs namespace LibraryMgmt.Controllers I am able to replicate this same problem in two different machines. My Excel will hang up and when i view the error details Description:Ī problem caused this program to stop interacting with Windows.Īdditional Hang Signature 1:Ę09ece3e9196e7c4f6001e3909536a40Īdditional Hang Signature 3:ĕd3a071ac38112e417d1a518b534cf8fĪdditional Hang Signature 5:Ę09ece3e9196e7c4f6001e3909536a40Īdditional Hang Signature 7:ĕd3a071ac38112e417d1a518b534cf8f Students.xls is 120 KB, Bookmaster.xls is 5381 KB. Students table has 349 rows while bookmaster table has 7322 rows. I have used the same code to export the list of students. This code works perfectly for small number of records in the table but for larger number of records i cannot open my xls sheet. I have used a code in which to export my bookmaster table data to excel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |