C# 从reportviewercontrol以PDF格式处理时System.OutOfMemoryException

C# 从reportviewercontrol以PDF格式处理时System.OutOfMemoryException,c#,sql,.net,azure,reporting,C#,Sql,.net,Azure,Reporting,我有以下例外情况:当我创建报表查看器时,我使用存储过程从SQL数据库获取信息,当它尝试处理报表时,会发生以下情况: 消息:本地报表处理过程中发生错误 InnerException:System.ArgumentException:参数无效 在System.Drawing.Bitmap..ctor(Int32宽度、Int32高度、PixelFormat格式)在System.Drawing.Bitmap..ctor(图像原始、Int32宽度、Int32高度)在System.Drawing.Bitma

我有以下例外情况:当我创建报表查看器时,我使用存储过程从SQL数据库获取信息,当它尝试处理报表时,会发生以下情况:

消息:本地报表处理过程中发生错误

InnerException:System.ArgumentException:参数无效

在System.Drawing.Bitmap..ctor(Int32宽度、Int32高度、PixelFormat格式)在System.Drawing.Bitmap..ctor(图像原始、Int32宽度、Int32高度)在System.Drawing.Bitmap..ctor(图像原始)在Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.Process32bppArgbImage(StringBuilder sb、StringBuilder imageContent、PDFIImage)在Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.ProcessImage(PdfImageImage)在Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndPage()在Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessPage(RPLRReport RPLRReport,Int32页码,FontCache sharedFontCache,列表'1 glyphCache)位于Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(报告报告、NameValueCollection deviceInfo、哈希表renderProperties、CreateAndRegisterStream CreateAndRegisterStream和RegisterStream)的Microsoft.ReportingServices.Rendering.ImageRenderer.RenderBase.Render(报表报表、NameValueCollection报表服务器参数、NameValueCollection设备信息、NameValueCollection客户端功能、哈希表和renderProperties、CreateAndRegisterStream CreateAndRegisterStream)。堆栈跟踪:位于Microsoft.Reporting.WebForms.LocalReport.InternalRender(位于Microsoft.Reporting.WebForms.LocalReport.InternalRender的字符串格式、布尔AllowentnalRenders、字符串设备信息、PageCountMode PageCountMode、CreateAndRegisterStream createStreamCallback、警告[]和警告)Microsoft.Reporting.WebForms.LocalReport.Render上的(字符串格式、布尔AllowentnalRenderers、字符串设备信息、PageCountMode PageCountMode、字符串和mimeType、字符串和编码、字符串和文件名扩展、字符串[]和流、警告[]和警告)(字符串格式、字符串设备信息、PageCountMode PageCountMode、字符串和mimeType、字符串和编码、字符串和文件名扩展、字符串[]和流、警告[]和警告)位于AppSingless472.App_Tools.PdfCreatorBase.GetArryBytesPdfConFoto(Int32 idguiaPorte)位于AppSingless472.WebApiController.SoporteController.SoportEnterGaComTo(FormData FormData,HttpRequestMessage请求)。TargetSite:Void InternalRender(System.String,布尔值,System.String,Microsoft.Reporting.WebForms.PageCountMode,Microsoft.ReportingServices.Interfaces.CreateAndRegisterStream,Microsoft.Reporting.WebForms.Warning[]ByRef)

以下错误偶尔发生在生产中(我从Azure获得此错误)

System.OutOfMemoryException消息TaskScheduler引发了异常。引发了类型为“System.OutOfMemoryException”的异常。
异常类型System.OutOfMemoryException失败的方法MultipartDataMediaFormatter.Converters.HttpContentToFormDataConverter+d\u 0.MoveNext

我已经犯这个错误好几天了,我无法解决它


感谢您的关注。

没有任何代码就很难调试您的应用程序。但是“内存不足”异常通常是变量太大而无法存储在ram中


从错误代码来看,您试图处理的图像似乎太大,程序无法处理。请尝试缩小导致错误的图像的大小

显示发生错误的代码。