Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

rdlc

reporting

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();
like image 252
Saqi Avatar asked Nov 22 '12 11:11

Saqi


2 Answers

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.

like image 195
UMAR-MOBITSOLUTIONS Avatar answered Sep 24 '22 09:09

UMAR-MOBITSOLUTIONS


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

The order is important here.

like image 42
jansokoly Avatar answered Sep 20 '22 09:09

jansokoly