Modify report logo image in code behind

I have a generic .RDL report file that will be used by serval different companies.  I want to programmatically modify the the embedded logo image filename in the rdl and pass the new dynamically created file to the report viewer.  I have tried reading the rdl into an xml document and modifying the image name, but there seems to be no way of passing the xml file to the viewer.  Any ideas?

Who is Participating?
jgvConnect With a Mentor Commented:
You can use a hidden parameter to pass in the image to use. This will vary depending on how you have the images setup but I'm assuming that the logo's are embedded since you mention this in your question.

Create a new report parameter called Logo that is a datatype String and Hidden.
Select the image object on the report.
Drop down the list of choices for the Value property. These are the names of the available embedded images.
Open the expression window for the Value property and set it to use the parameter you just created ( =Parameters!Logo.Value)
When the report is run, pass the name of the image file you want to use as the parameter value.

You can test this by leaving the image parameter visible and typing in the logo name.
mdunlap99Author Commented:
Thanks for the tip.  This makes perfect sense now.  I will give it a go.
mdunlap99Author Commented:
Worked like a champ.  Many thanks!!!
mdunlap99Author Commented:
Good work indeed.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.