我想导出带有图像的报告。存储的图像在DB中以URL格式显示。
我的替代方案是物理下载文件并传递文件路径以显示图像,但这种方式似乎是多余的。 Sample from here
最好的方法是什么?非常感谢!
我最终使用下面的代码下载图像并在我在RDLC中显示之前将其转换为base64。
var webClient = new WebClient(); byte[] imageBytes = webClient.DownloadData(urlimg); DataRow drow = table.NewRow(); drow["filepath"] = Convert.ToBase64String(imageBytes);
RDLC配置如下图所示。