Show image on RDLC report from database by image path

17,773

Solution 1

The problem was that I did set the image source property of the image control on the report to "database", which is incorrect. Because the image is not saved in the database, but only the path to it. So I changed it to "External" and walah! It works like a charm. Thank you all for your help.

Solution 2

For display the external image in RDLC report,

  • You have to set EnableExternalImages to true.

  • The file path you are using should be absolute path. The path you are using should be in the form of "file:///C:/RDLCTest/TestImage.png".

  • Also, you have to set the MIME type for the image control. Each file type has its own MIME type. Refer http://webdesign.about.com/od/multimedia/a/mime-types-by-file-extension.htm for list of MIME types based on file extension.

Share:
17,773
Gauri K.
Author by

Gauri K.

Updated on June 04, 2022

Comments

  • Gauri K.
    Gauri K. almost 2 years

    The image path is stored in the SQL Server 2008 database. On my RDLC report, I have a image field. I have set this field to get the image path from the database column in the database. I also have set in the report viewer the "EnableExternalImages" property to true. I don't know what I am missing, but the only "image" my report shows is the red mark. What am I missing?