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

19,545

Solution 1

I have experience when you enable external images using Code, it works on local / development environment but while deployment on server it does not works and reports raise error:

"The enable external images property has not been set for this report"

In order to solve this issue, use EnableExternalImages="true" property in ASPX or design file where you are using ReportViewer Control and it will work perfectly.

Solution 2

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

The order is important here.

Solution 3

I hope this image is a help in your Windows Application.Activate your Reportviewer->Properties->LocalReport->EnableExternalImage and set it to Trueenter image description here

Solution 4

As mentioned here, the path of the image 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});
Share:
19,545
Saqi
Author by

Saqi

Updated on June 24, 2022

Comments

  • Saqi
    Saqi almost 2 years

    I am trying to add an external photo as the logo along with the report on 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();