c# - 尚未为此报表设置启用外部图像属性?

标签 c# reporting rdlc

我正在尝试将外部照片添加为 Logo 以及 report.rdlc 文件中的报告。我有这个错误

The enable externalimages property has not been set for this report

enter image description here

这是我的代码。

 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();

最佳答案

我有使用代码启用外部图像的经验,它适用于本地/开发环境,但在服务器上部署时它不起作用并报告引发错误:

“尚未为此报告设置启用外部图像属性”

为了解决这个问题,在 ASPX 或使用 ReportViewer 控件的设计文件中使用 EnableExternalImages="true" 属性,它将完美地工作。

关于c# - 尚未为此报表设置启用外部图像属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13511700/

相关文章:

mongodb - 如何使用 MongoDB 进行报告?

sql-server-2005 - 如何创建 SQL Server 2005 数据库的实时副本?

c# - 创建包含多个表的 rdlc 报告(一对多关系)

c# - 如何在不同的控件中显示列表框选定项的属性

c# - Azure Web Apps 超时长处理请求

mysql - 仅第一个开始日期和最后一个完成日期

c# - 向 RDLC 报告添加新数据集时 Visual Studio 挂起

visual-studio-2008 - Visual Studio 2010是否要求将在VS2008上创建的RDLC转换为RDLC 2008格式?

c# - 通过包含字母搜索列表 C#

c# - 具有非接口(interface)的构造函数参数的依赖注入(inject)