把属性里面的 Source 设置成External,
Vaule设置成参数的值 ‘=Parameters!img.Value’,
然后在cs源文件里面添加如下方法传参数
ReportParameter[] image = new ReportParameter[1];
string path = "file:///" + Application.StartupPath + "//image.jpg";
image[0] = new ReportParameter("image", path);
this.reportViewer1.LocalReport.SetParameters(image);
注意 "file:///" + Application.StartupPath + "//image.bmp";
比如图片路径是 D:/image.bmp
则应该写成“file:///D:/image.bmp”
本文介绍如何在报表中设置外部图片源并传递图片路径参数的方法。具体步骤包括:配置属性为外部源,设置值为参数值,并通过C#代码传参。
994

被折叠的 条评论
为什么被折叠?



