本文介绍了如何在RdLC中提供外部图像的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在rdlc报告中放置一个图像。为此,我选择一个图像项并将其设置为:
图像源 - 外部
fx- = http:// localhost:1111 / ImageHandler.ashx?code =+ Fields!Code.Value +&id =+ Fields!ID.Value
我已经创建了从数据库中选择二进制数据并给出图像的处理程序。
但是我没有在报告中显示图像....
I need to place an image in rdlc report.For this I pick an image item and set it properties like:
Image Source - External
fx- ="http://localhost:1111/ImageHandler.ashx?code="+Fields!Code.Value+"&id="+Fields!ID.Value
I have creted handler that picks binary data from database and gives image.
But I dont get imge shown on report....
推荐答案
public void ProcessRequest(HttpContext context)
{
Byte[] imageData;
using (FileStream fs = new FileStream(@"C:\Images\000375.jpg", FileMode.Open))
{
imageData = new Byte[fs.Length];
fs.Read(imageData, 0, (int)fs.Length);
}
context.Response.Clear();
context.Response.ContentType = "image/jpg";
context.Response.BinaryWrite(imageData);
}
这篇关于如何在RdLC中提供外部图像的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!