tags:

views:

555

answers:

2

i have a RDLC with a embedded Image taken with a Nikon Coolpix 5600 that raises the following error when i call the Render function.

example image: http://img140.imageshack.us/img140/4906/dscn1559u.jpg

does somebody know what`s wrong with that image?

tia

The Error:

    [ArgumentOutOfRangeException: Nicht negative Zahl erforderlich.
Parametername: value]
   System.IO.MemoryStream.set_Position(Int64 value) +7679482
   Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasPDF.MonochromeJpeg(MemoryStream memStream) +601
   Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasPDF.ProcessImage(CanvasImagePDF image, Double left, Double top, Double width, Double height, Boolean scaleImage) +1656
   Microsoft.ReportingServices.Rendering.ImageRenderer.CanvasPDF.DrawImage(OutlineObjects outlines, CanvasImage image, Double left, Double top, Double width, Double height) +235
   Microsoft.ReportingServices.Rendering.ImageRenderer.Image.RenderToPage(Measurement parentClipBorder) +1275
   Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.RenderToPage(Measurement parentClipBorder) +485
   Microsoft.ReportingServices.Rendering.ImageRenderer.Rectangle.RenderToPage(Measurement parentClipBorder) +373
   Microsoft.ReportingServices.Rendering.ImageRenderer.RenderingItemContainer.RenderToPage(Measurement parentClipBorder) +246
   Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.ProcessPages(CompositionBase theComposition, Report theReport, Boolean needTotalPages, Int32 startPage, Int32 endPage, Boolean render) +912
   Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport.RenderReport(Report report, NameValueCollection deviceInfo, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStreamCallback, Int32 streamPageNumber) +652
   Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream) +81

[ReportRenderingException: Fehler beim Rendern des Berichts.]
   Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, EvaluateHeaderFooterExpressions evaluateHeaderFooterExpressions, CreateAndRegisterStream createAndRegisterStream) +142
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension renderer, DateTime executionTimeStamp, GetReportChunk getCompiledDefinitionCallback, ProcessingContext pc, RenderingContext rc, CreateReportChunk cacheDataCallback, Boolean& dataCached) +1775

[WrapperReportRenderingException: Fehler beim Rendern des Berichts.]
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension renderer, DateTime executionTimeStamp, GetReportChunk getCompiledDefinitionCallback, ProcessingContext pc, RenderingContext rc, CreateReportChunk cacheDataCallback, Boolean& dataCached) +2417
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension renderer, DateTime executionTimeStamp, GetReportChunk getCompiledDefinitionCallback, ProcessingContext pc, RenderingContext rc) +72
   Microsoft.Reporting.LocalService.RenderWithDataCache(PreviewItemContext itemContext, ParameterInfoCollection reportParameters, IEnumerable dataSources, DatasourceCredentialsCollection credentials, IRenderingExtension renderer, ReportProcessing repProc, CreateAndRegisterStream createStreamCallback, ReportRuntimeSetup runtimeSetup) +2069
   Microsoft.Reporting.LocalService.Render(PreviewItemContext itemContext, Boolean allowInternalRenderers, ParameterInfoCollection reportParameters, IEnumerable dataSources, DatasourceCredentialsCollection credentials, CreateAndRegisterStream createStreamCallback, ReportRuntimeSetup runtimeSetup, ProcessingMessageList& warnings) +441
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +364

[LocalProcessingException: Fehler bei der lokalen Berichtsverarbeitung.]
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +418
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +199
   Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +57
   HrmSuite.MvcWebClient.EmployeePresentation.Render(Guid guid, String& mimeType, String reportMapPath, Boolean anonym) in C:\VS2008\HrmSuite\HrmSuite.MvcWebClient\Reports\EmployeePresentation.vb:226
   HrmSuite.MvcWebClient.EmployeeController.RenderReport(Guid guid, Boolean anonym) in C:\VS2008\HrmSuite\HrmSuite.MvcWebClient\Controllers\EmployeeController.vb:152
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +230
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +52
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +399
   System.Web.Mvc.Controller.ExecuteCore() +126
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +27
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +151
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Edit

the EXIF Data seems to be the cause, still investigating :)

+1  A: 

The image needs to be in Base64 encoding in order to render in SSRS.

Here is a VB.NET function that will do the encoding. You can probably optimize, I just pasted an old function of mine.

Public Function ConvertImageToBase64String(ByVal img As Image) As String
    Dim output As String = ""
    Dim outputArray() As Byte
    Dim stream As New MemoryStream
    img.Save(stream, Drawing.Imaging.ImageFormat.Png)
    outputArray = stream.ToArray()
    stream.Close()
    output = Convert.ToBase64String(outputArray)
    Return output
  End Function
Jon
thx, what you said is correct but its not the source of my problem.my report is client side, i embedded the image over Visual Studios Report Designer. so in my case the image is already Base64 encoded and also visible in design view, but when i render my report (as pdf) it raises the error
marc.d
Ahh, i overlooked that this was happening during the PDF rendering. My bad.
Jon
+1  A: 

i solved the problem by re-encoding the whole image with System.Drawing.Bitmap not a perfect solution but it works for now.

marc.d