C# – Show image on RDLC report from database by image path

crdlcreporting-servicessql-server-2008wpf

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?

Best Answer

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.

Related Topic