Setting image source in RDLC report dynamically

后端 未结 2 1077
渐次进展
渐次进展 2020-12-29 06:36

I\'m using the client-side reporting capabilities that are bundled in with Visual Studio 2010. I\'ve got an RDLC file defined, currently with embedded images for branding p

2条回答
  •  执念已碎
    2020-12-29 07:16

    I was having the same problem, however the accepted solution didn't quite work for me. Turns out that I needed to set EnableExternalImages to true in addition to providing the path in URI format and setting my Image.Value to =Parameters!ReportLogo.Value.

    report.EnableExternalImages = true;
    ReportParameter[]  parameters = new ReportParameter[3];
    ...
    Uri pathAsUri =  new Uri(_info.LogoPath);
    parameters[2] = new ReportParameter("ReportLogo", pathAsUri.AbsoluteUri);
    report.SetParameters(parameters);
    

提交回复
热议问题