Articles in this section

How to Display Base64 Images in Bold Reports

Published:
Updated:

To display image data stored as a Base64 data URI string in Bold Reports, add an Image report item, set its Source to Database, select the appropriate MIME Type, and bind the image field using an expression that removes the data:image/...;base64, prefix. This approach can be used when image data is stored as text within a dataset and needs to be displayed in a report.

When to Use This

Use this method when a dataset field contains image data as a Base64 data URI string, for example:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

If your dataset contains raw binary image data (varbinary, image, or BLOB columns), bind the field directly to the Image item instead of using the expressions described in this article.

Steps

  1. Open the report in the Report Designer.

  2. In the item panel under Basic Items, drag the Image report item into the design area.

    image.png

  3. In the properties panel, under Basic Settings, set Source to Database.

  4. Set MIME Type to match your image format, such as image/png. The MIME type is required for database images; the image renders as a blank box if it is missing or wrong.

  5. In the Value property, open the expression editor and enter an expression that removes the data URI prefix. Use either option below.

    Option A : replace the prefix with an empty string (works for any PNG prefix regardless of length):

    =Replace(Fields!ImageData.Value, "data:image/png;base64,", "")
    

    image.png

    image.png

    Option B : trim the first 22 characters, which is the length of data:image/png;base64,:

    =Right(Fields!ImageData.Value, Len(Fields!ImageData.Value) - 22)
    

    image.png

  6. Save the report, then run a preview to confirm the image displays. Database-sourced images render only in preview, not on the design surface.

    image.png

Result

The report preview shows the decoded image in the Image item. Each row that carries a valid Base64 value renders its own image.

Related articles

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied