tags:

views:

1006

answers:

1

I have a bunch a reports that are printed out and mailed to clients. At the top of the report is the return address, left aligned. I was asked to add an optional logo to the report. This logo should be left of the return address. (The logo and all other info is stored in the database). So if the logo exists, you SHOULD see:

<someimage> <Return Address>

And if no logo exists, you SHOULD see:

<Return Address>

There are many different logos possible placed in many different reports, so to make life easier, the logo was implemented as a subreport. The subreport just grabs the correct logo image, and then it automatically displays in the report.

The problem I'm having is this. If the log DOES NOT exist, then we want the return address left aligned, as shown above. But what is happening is that while the subreport shows nothing, it still takes up the space where the logo WOULD be, and the return address is floating a few inches to the right of the left side of the page.

           <Return Address>

SO... is there a setting I can use/set to get the subreport to either not show, or not take up any space, if there is no logo to be displayed?

Sorry, hope I made this clear enough. I'm totally new to RDL's.

+1  A: 

You should be able to set an expression on the subreport's visibility so that it does not show if there isn't a logo.

Here is the XML from an RDL I had handy:

<Subreport Name="SubReport">
  <ReportName>SubReport</ReportName>
  <Visibility>
    <Hidden>=Not Parameters!ShowLogo.Value</Hidden>
  </Visibility>
</Subreport>

This tests against a boolean parameter called ShowLogo, but you could just as easily test the value of another parameter (perhaps the length of a URL?).

To be clear, when specifying the expression for the "Hidden" property, you want it to evaluate to False when you want the element to display. If your expression evaluates to True, that means that the element will be hidden.

Ian Robinson