Saturday, April 4, 2015

Adding Base64 Encoded Images To Jasper Reports

Base64

Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. This method can be used to transfer binary data as textual data. Click here to read more on Base64

Adding To Jasper Reports

If you need to add the image through a URL(or a file location) to the report you can easily do it by going through image properties. But if you need to set the image through a Base64 encoded character string then you need to add it to the report as shown below.

Assume that the parameter for the Base64 encoded string is 'p_logoURL'. Then you can add this parameter to the image expression as shown below.

Image Expression
That's it. You can see the image in your report.

3 comments:

  1. I test with this, but my code is not working

    ReplyDelete
    Replies
    1. Hi, Did you check the correctness of the Base64 encoded character string ?

      Delete