-2

I have the following exception when I am creating report viewer, I fetch the information from a SQL database using a stored procedure and when it tries to process the report the following happens:

Message: An error occurred during local report processing..

InnerException: System.ArgumentException: Parameter is not valid.

at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Image original, Int32 width, Int32 height) at System.Drawing.Bitmap..ctor(Image original) at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.Process32bppArgbImage(StringBuilder sb, StringBuilder imageContent, PDFImage image) at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.ProcessImage(PDFImage image) at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndPage() at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessPage(RPLReport rplReport, Int32 pageNumber, FontCache sharedFontCache, List`1 glyphCache) at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream). StackTrace: at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) at Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) at AppSingless472.App_Tools.PdfCreatorBase.GetArryBytesPdfConFoto(Int32 IdGuiaSoporte) at AppSingless472.WebApiController.SoporteController.SoporteEntregaConFoto(FormData formData, HttpRequestMessage request). TargetSite: Void InternalRender(System.String, Boolean, System.String, Microsoft.Reporting.WebForms.PageCountMode, Microsoft.ReportingServices.Interfaces.CreateAndRegisterStream, Microsoft.Reporting.WebForms.Warning[] ByRef).

The following error happens occasionally and in production (I get this error from Azure)

System.OutOfMemoryException Message An exception was thrown by a TaskScheduler. Exception of type 'System.OutOfMemoryException' was thrown.
Exception type System.OutOfMemoryException Failed method MultipartDataMediaFormatter.Converters.HttpContentToFormDataConverter+d__0.MoveNext

I have been several days with this error, and I cannot solve it

Thanks for the attention.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Diego Diaz
  • 15
  • 1
  • 7

1 Answers1

0

It's hard debugging your application without any code. But the "out of memory" exception is usually variables too big to be stored in your ram

From your error code it seems like the image you're trying to process is too big for your program to handle. Try downscaling the images that causes an error