asp.net 如何从设计上给予rdlc外部形象中形象的一个相对路径

m2xkgtsf  于 2023-08-08  发布在  .NET
关注(0)|答案(1)|浏览(127)

我想给予一个相对路径在rdlc的形象。我尝试将属性的value字段设置为:
file:\/images/sn_logo.gif
但它不起作用是否有任何选择,因为我不能给予绝对路径的部署位置将是不一样的。

qfe3c7zg

qfe3c7zg1#

我在部署方面也有类似的问题。本文采用的方法是在RDLC设计中设置图像路径参数。调用报表查看器时指定图像路径。

// I use 'GetCurrentDirectory' so that I can deploy it to anotherwhere.
string imagePath = @"file:///" + Directory.GetCurrentDirectory() + @"\image.png";

this.reportViewer1.LocalReport.SetParameters(new ReportParameter[]
    {
        new ReportParameter("imagePath ", imagePathParameterName) 
    });

字符串

相关问题