The enable externalimages property is not set for this report?

I am trying to add an external photo as a logo along with the report in the report.rdlc file. I have this error

The enable externalimages property has not been set for this report.

enter image description here ?

Here is my code.

  try { this.pedidosTableAdapter.Connection.ConnectionString = con.MysqlConnect(); this.pedidosTableAdapter.Fill(this.fabricacaoDataSet8.pedidos, Pages.relatorios.num); this.reportViewer1.RefreshReport(); } catch { } // for external image this.reportViewer1.LocalReport.EnableExternalImages = true; ReportParameter parm = new ReportParameter(); parm=(new ReportParameter("path", @"C:\logo.jpg",true)); this.reportViewer1.LocalReport.SetParameters(parm); this.reportViewer1.Refresh(); 
+7
source share
3 answers

I have experience when you include external images using code, it works in the local / development environment, but when deployed to the server it does not work and reports an error:

"The resolution property for external images was not set for this report.

To solve this problem, use the EnableExternalImages="true" property in ASPX or the project file in which you use ReportViewer Control and it will work fine.

+4
source

The problem here is that you are calling this.reportViewer1.RefreshReport(); before setting this.reportViewer1.LocalReport.EnableExternalImages = true; .

The order is important here.

+1
source

As mentioned here , the image path must be in URL format, i.e. @"file:///C:\logo.jpg"

Or you can try

 var filepath = new Uri("C:\logo.jpg"); var path = new ReportParameter("Path", filepath.AbsolutePath); this.reportViewer1.LocalReport.SetParameters(new ReportParameter {Path = path}); 
0
source

All Articles