Click here to Skip to main content
16,019,085 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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....
Posted
Updated 29-May-12 22:04pm
v2

 
Share this answer
 
Hi Pratika,

You should set the Content type as "image/{ImageFormat}"

Please find the Sample Code part below
C#
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);                    
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900