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

While I am exporting the report rdlc file in to a excel in MVC5 Application (VS2013) iam getting an error message like., Memory Out of Exception. The records are more than 1 lakh.

The detailed error is given below:

HTML
Server Error in '/' Application.
Exception of type 'System.OutOfMemoryException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.IO.MemoryStream.set_Capacity(Int32 value) +93
   System.IO.MemoryStream.EnsureCapacity(Int32 value) +64
   System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) +330
   System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) +97
   System.IO.StreamWriter.Write(String value) +117
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.OoxmlComplexType.WriteRawTag(TextWriter s, Int32 depth, Dictionary`2 namespaces, String tagname, Boolean preserveWhitespace, String tagNamespace, Object data) +82
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Rst.WriteElements(TextWriter s, Int32 depth, Dictionary`2 namespaces) +47
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Rst.Write(TextWriter s, String tagName, Int32 depth, Dictionary`2 namespaces) +49
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Cell.WriteElements(TextWriter s, Int32 depth, Dictionary`2 namespaces) +82
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Cell.Write(TextWriter s, String tagName, Int32 depth, Dictionary`2 namespaces) +49
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Row.Write_c(TextWriter s, Int32 depth, Dictionary`2 namespaces) +123
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Row.WriteElements(TextWriter s, Int32 depth, Dictionary`2 namespaces) +12
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.spreadsheetml.x2006.main.CT_Row.Write(TextWriter s, String tagName, Int32 depth, Dictionary`2 namespaces) +49
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.StreamsheetParser.WriteTagInCollection(OoxmlComplexType tag, StreamSheetSection section, String tagname, String coltagname) +166
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.StreamsheetParser.WriteRow(CT_Row row) +32
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.StreamsheetParser.WriteTag(OoxmlComplexType tag) +182
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.XMLModel.XMLStreamsheetModel.AdvanceStreamsheetTo(StreamSheetSection newSection, Boolean head) +95
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.XMLModel.XMLStreamsheetModel.CreateRow(Int32 index) +23
   Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.OpenXmlGenerator.SetRowContext(Int32 rowIndex) +62
   Microsoft.ReportingServices.Rendering.ExcelRenderer.Layout.LayoutEngine.RenderPageToExcel(IExcelGenerator excel, String key, Dictionary`2 sharedBorderCache, Dictionary`2 sharedImageCache) +1534
   Microsoft.ReportingServices.Rendering.ExcelRenderer.MainEngine.RenderRPLPage(RPLReport report, Boolean headerInBody, Boolean suppressOutlines) +151
   Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) +803
   Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.InvokeRenderer(IRenderingExtension renderer, Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) +28
   Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer) +543

[ReportProcessingException: An unexpected error occurred in Report Processing.]
   Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer) +820
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderSnapshot(IRenderingExtension newRenderer, RenderingContext rc, ProcessingContext pc) +146
   Microsoft.Reporting.LocalService.Render(String format, String deviceInfo, String paginationMode, Boolean allowInternalRenderers, IEnumerable dataSources, CreateAndRegisterStream createStreamCallback) +526
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +302

[LocalProcessingException: An error occurred during local report processing.]
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +354
   Microsoft.Reporting.WebForms.LocalModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileNameExtension) +249
   Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +289
   Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +308
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408 


Please Help me in this

Thanks.
Posted

1 solution

Dear Phani Bharadwaj,

I had followed this post for report in MVC.

http://myprogramminglife.com/rdlc-report-in-asp-net-mvc-3/[^]


Thank You.
 
Share this answer
 
Comments
Phani Bharadwaj 12-Aug-14 9:36am    
Hi Manoj,

I now how to create but it is problem with exporting to excel more than 1 lakh records to excel. It is getting said above error.

Thanks You,

T. S. Phani Bharadwaj
Manoj B. Kalla 12-Aug-14 9:46am    
required only in EXCEL?
Member 10411062 2-Apr-15 6:44am    
yes. only in excel. pls

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