使用C#Visual Studio从URL显示RDLC中的图像

问题描述 投票:0回答:1

我想导出带有图像的报告。存储的图像在DB中以URL格式显示。

我的替代方案是物理下载文件并传递文件路径以显示图像,但这种方式似乎是多余的。 Sample from here

最好的方法是什么?非常感谢!

c# reporting-services rdlc
1个回答
0
投票

我最终使用下面的代码下载图像并在我在RDLC中显示之前将其转换为base64。

var webClient = new WebClient();
byte[] imageBytes = webClient.DownloadData(urlimg);

DataRow drow = table.NewRow();

drow["filepath"] = Convert.ToBase64String(imageBytes);

RDLC配置如下图所示。 RDLC configuration

© www.soinside.com 2019 - 2024. All rights reserved.