views:

274

answers:

2

Hi there

Is it possible to pass parameter for URL logo so the logo can be displayed on the report (reporting services / .rdlc file)?

Thanks

A: 

Do you mean simply displaying an image on the page? If so, you just use an image control.

If you mean the url could change for different report scenarios, you could pass the url in as a string, then possible set a reference to it using expressions. If you could provide more detail, I might be able to help a little more.

Mark Struzinski
I want to display an image but the source of the file is coming from parameter. I have a generic report and also have a multiple clients accesing this report and it will be nice to display the report as well as their logo.
dewacorp.alliances
+3  A: 

Yes.

Add a new reporting control to your project.

Create a Report Parameter for the report.

Report=>Report Parameters, Add a Parameter "HeaderImage".

Drag a Image control on to the report. Set the source to "external" Set the value to "=Parameters!HeaderImage.Value"

Run this code when you run the report.

ReportViewer1.LocalReport.EnableExternalImages = true;

List<Microsoft.Reporting.WebForms.ReportParameter> rlist = 
    new List<Microsoft.Reporting.WebForms.ReportParameter>();
rlist.Add(new Microsoft.Reporting.WebForms.ReportParameter("HeaderImage", 
    "http://static.nfl.com/static/site/img/global/nfl-logo.png"));

ReportViewer1.LocalReport.SetParameters(rlist);

Hope that helps

Mosquito Mike