Query: How to put Images in Reports (Microsoft ReportViewer) through code at runtime/dynamically?
You can achieve this with charm. You can easily have images on your report, even the images that are on the Web.
Assumption:
This article assumes that a user has basic idea about RDLC, Microsoft ReportViewer and DataSource. This Article does not teach the basics of how to generate Reports in Microsoft Report Viewer.
To learn about ReportViewer and how to build reports, read this free book by Mahesh Chand:
Reports using Report Viewer in Visual Studio 2005.
In ReportViewer, you have 2 options for images: External or Embedded.
1. Embedded:
If you have images in your application and you want to use them.
Stage I: Then, you first need to embed the images in to be used in Reports. To embed an image in Reports:
a) Open the RDLC File.
b) Go to the Menu Item: Report > Embedded Images. Click on: New Image.
c) Browse for the image. Edit Name for the image chosen as desired (example, here: TestImage). OK.
Stage II:
d) Use an Image control on your RDLC file.
e) Set the Image's Property-Source = Embedded.
f) Reserve a Report's DataSource Member for the image Path. For example- DataSource.ImgPath.
g) Set the value for image path from the code in DataSource.ImgPath.
For example: DataSource.ImgPath = "TestImage";
h) Do the normal stuff to bind DataSource etc.
i) Done. Enjoy your image in the Report.
2. External:
If you do not have images in your Application. That is, you want to use an external image.
a. Use an Image control on your RDLC file.
b. Set the Image's Property-Source = External.
c. Reserve a Report's DataSource Member for the image Path. For example- DataSource.ImgPath.
d. Set the value for image path from the code in DataSource.ImgPath.
For example: DataSource.ImgPath = "http://www.google.com/intl/en_ALL/images/logo.gif";
e. The following self explanatory code also needs to be written:
reportViewer1.LocalReport.EnableExternalImages = true; (reportViewer1 is the Name for the ReportViewer Control)
f. Do the normal stuff to bind DataSource etc.
g. Done. Enjoy your image in the Report.

Raj SharmaPosted Jul 9, 2012, 12:13 PM
Hello Sir, I am working on an application in there is a requirement on approximate image comparison from uploaded image to pre stored images ,but I am not getting solutions, plz show me the path
SAM SAMPosted Feb 29, 2012, 1:30 AM
I do not display a field of type Image in MicrosoftReport know how I should set the DataSource. My image is stored in a database field of type Image. Please help me.
vanithaPosted Dec 22, 2011, 2:20 AM
u are really advance thanks man
dd ssPosted Dec 16, 2010, 1:53 PM
I follow your instruction for option 1 embedded image. It doesn't work. Can you explain detail about step f f) Reserve a Report's DataSource Member for the image Path. For example- DataSource.ImgPath. g) Set the value for image path from the code in DataSource.ImgPath. For example: DataSource.ImgPath = "TestImage"; I created user defined class ReportMasterData with one string attribute imgPath. string imgPath; I set the value inside my code all other attribute can be displayed on the report (like text field) but the image not show.