Display Image From Database in .RDLC Report - Stack Overflow
Display Image From Database in .RDLC Report - Stack Overflow
com/questions/10013322/display-image-from-database-in-rdlc-report
_
Stack Overflow is a community of 4.7 Join the Stack Overflow community to:
million programmers, just like you,
helping each other.
In my sql database I have a CompanyMaster table in which i have one column Company Logo. In that column I only store the path of the
company logo image.
How do I do this?
rdlc
3 Answers
You could use Image control in rdlc file. Common approach is to write an Webservice that
returns the Image content. So your Image URL will point to web service URL.
using System;
using System.Web;
using System.Drawing.Imaging;
using Microsoft.Web;
using MyControllers;
1 of 3 24/02/2016 3:58 PM
Display Image From Database in .rdlc report - Stack Overflow http://stackoverflow.com/questions/10013322/display-image-from-database-in-rdlc-report
public ServeImage()
{
}
if (parameters["ID"] != null)
{
MyController myCntl = new MyController();
// myCntl.GetImageFromDB returns the binary[] content from database
retVal = new ImageInfo(myCntl.GetImageFromDB(parameters["ID"]));
}
return retVal;
}
}
Ok.. I think, I should be sorry for making you click on to an another page. Time for steps.
2.) Insert an image in your Report. Set the image source as external.
4.) Enter the value of your image file link that is saved in Database eg . of such expression is :
"file:/// " + First(Fields!Imagelink.Value, "DataSet1") + ".jpeg"
5.) Important thing is that your Imagelink value must be the complete path to that image.
I hope this may help miss Kleopatra – Rahul Jul 12 '13 at 10:54
2 of 3 24/02/2016 3:58 PM
Display Image From Database in .rdlc report - Stack Overflow http://stackoverflow.com/questions/10013322/display-image-from-database-in-rdlc-report
3- Set the Image to be External external and set "Use this image" to be the parameter:
[@ParameterName].
4- Finally Set the Parameter Value in Code behind before loading the report.
3 of 3 24/02/2016 3:58 PM