0

Nikon Coolpix 5600 で撮影した画像が埋め込まれた RDLC があり、Render 関数を呼び出すと次のエラーが発生します。

サンプル画像: http://img140.imageshack.us/img140/4906/dscn1559u.jpg (リンク切れ)

誰かがその画像のどこが悪いのか知っていますか?

エラー:

    [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

編集

EXIFデータが原因のようですが、まだ調査中です:)

4

2 に答える 2

1

SSRS でレンダリングするには、画像を Base64 エンコーディングにする必要があります。

エンコードを行う VB.NET 関数を次に示します。おそらく最適化できます。私の古い関数を貼り付けただけです。

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
于 2009-06-16T13:55:14.140 に答える
0

System.Drawing.Bitmap を使用して画像全体を再エンコードすることで問題を解決しましたが、これは完璧な解決策ではありませんが、今のところ機能します。

于 2009-06-19T08:51:55.627 に答える