Modify report logo image in code behind

Posted on 2008-11-10
Last Modified: 2012-08-14
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?

Question by:mdunlap99
    LVL 12

    Accepted Solution

    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.

    Author Comment

    Thanks for the tip.  This makes perfect sense now.  I will give it a go.

    Author Comment

    Worked like a champ.  Many thanks!!!

    Author Closing Comment

    Good work indeed.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now