Click here to Skip to main content
15,909,445 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello

I developed application that exports dataset value to excel in mvc3. I am having about 60,000 records and 22 columns in the table. If i export 
to excel file, it takes more than 16 MB, i cant able to open the exported excel file, it shows loading symbol for long time. 
Kindly give me the solution for this problem.
Posted

1 solution

Sorry, but you did not provide enough information about your issue, like the method you used to export data to MS Excel file, etc. Nevertheless...

If you have about 60K records in 22 columns, Excel file could takes over 16 MB. Using formatting causes successive file growth.


Tip: Next time, please be more specific ;)
 
Share this answer
 
Comments
farogh haider 13-May-14 0:01am    
Thanks, for replying me
Below code is using to generate excel.



public ActionResult ExportToExcelInvoiceInView(int sno)
{

gvUserInfo.DataSource = Datasource; // Binding with GridView
gvUserInfo.ShowFooter = true;

gvUserInfo.DataBind();

GridViewRow footerRow = gvUserInfo.FooterRow;
Label lbl = new Label();
lbl.Text = footer;
footerRow.Cells[lastColumnIndex].Controls.Add(lbl);

System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gvUserInfo.RenderControl(htw);
byte[] buf = DocWriter.GetISOBytes(sw.ToString());
return new BinaryContentResult(buf, "Invoice.xls");

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900