I have an app where it loads the image to a pic box from a path that is stored in an Access database. The image itself is not stored in the database.

I have searched everywhere for a solution to get the image to load to the report viewer but so far just get the red X.
reportViewer.LocalReport.EnableExternalImages = true ( this is on the report)
=Fields!BeforePhoto.Value=PhotoBefore.Image = Image.FromFile(lblPhotoFileBefore.Text)
=Fields!BeforePhoto.Value=Image.FromFile(lblPhotoFileBefore.Text)
= Fields!BeforePhoto.Value & "File: // lblPhotoFileBefore.ToString"
= Fields!BeforePhoto.Value = "File: // lblPhotoFileBefore.ToString"

The report shows hard coded images only.

Recommended Answers

All 3 Replies

First of all, add images into report resource.

This is supposed to be dynamic..so I won't know what images the user would input to the pic box on the form. Would not know what folder they would be in. Can't add the images to the report resource since that would not work for me and my project.

="file:///" & Fields!BeforePhoto.Value
Set the source to External
when you do this you do not need to put in the mimet type. it's ignored anyway.
MOST important...

For the reportviewer..refresh the report BEFORE external is set to true. Otherwise you get the red x.
dataset adapter fill here
Me.ReportViewer1.RefreshReport()
ReportViewer1.LocalReport.EnableExternalImages = True
Me.ReportViewer1.RefreshReport()

Thanks To Jordan..otherwise i would still be trying to get this to work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.