none
Issue with showing images in Reporting Services 2008

    Question

  • Hi guys

    I'm creating a solution to let users draw images (their signatures actually) within a HTML5 canvas and then store them in a database table. As you might know, the canvas element has a method to export the image data. What I'm using is:

    canvas.toDataURL("image/png")

    That'll generate a long string that would look similar to:

    data:image/png;base64,iVBORw0KGgoAA... (a long list of similar characters)

    And then I'm storing that in a database. 

    I can easily create an image on a web page and assign this to it and it'll show the image on the screen. However, my issue is when I'm trying to embed it into an SSRS report.

    In my report, I added an "Image" and changed its source to Database. Then I used the query field containing the image data and changed the value of "Use this MIME type" to "image/png". It didn't work and I got warnings like this:

    Warning 2 [rsInvalidExternalImageProperty] The value of the ImageData property for the image ‘Image2’ is “=Fields!Signature.Value”, which is not a valid ImageData. C:\Users\mmiri\Documents\Visual Studio 2008\Projects\eSignature\eSignature\Report1.rdl 0 0

    Warning 1 [rsInvalidExpressionDataType] The Value expression used in image ‘Image2’ returned a data type that is not valid. C:\Users\mmiri\Documents\Visual Studio 2008\Projects\eSignature\eSignature\Report1.rdl 0 0

    I even changed the source value to =Convert.FromBase64String(Fields!Signature.Value) and it didn't work either. The warnings I received were:

    Warning 2 [rsInvalidExternalImageProperty] The value of the ImageData property for the image ‘Image2’ is “=Convert.FromBase64String(Fields!Signature.Value)”, which is not a valid ImageData. C:\Users\mmiri\Documents\Visual Studio 2008\Projects\eSignature\eSignature\Report1.rdl 0 0
    Warning 1 [rsRuntimeErrorInExpression] The Value expression for the image ‘Image2’ contains an error: Invalid character in a Base-64 string. C:\Users\mmiri\Documents\Visual Studio 2008\Projects\eSignature\eSignature\Report1.rdl 0 0

    I even tried to remove the "data:image/png;base64" bit from the field and it didn't work either. Did some research on the web and couldn't find any helpful suggestions.

    Can you guys think of a workaround or solution? I would really appreciate your help.

    I can provide more details if needed. Thanks.


    Friday, August 23, 2013 1:27 AM

Answers