Reporting Services hiding and moving text boxes

  • I am making a report to be able to print labels. The labels are coming out great and are lined up correctly! The problem I'm having is that I have a 2nd address line that is only populated for 10 out of 1000 labels. They want me to be able to move up the city/state/zip under the first addr. line as if Addr2 didn't exsist. Can I do this?

    Code

    Name

    Addr1

    Addr2

    City/State/Zip

  • I take it each label is a repetition of some sort of list or some other type of container control...

    The easiest albeit somewhat harder to manage down the road would be to just put everything into 1 textbox.

    =Code & vbcrlf & _

    Name & vbcrlf & _

    Addr1 & vbcrlf & _

    Addr2 & vbcrlf & _

    City/State/Zip

    Then you just need to modify it to test for addr2=Nothing using IIF on whether or not to include that line.

    Or you could look into changing the visibility of the addr2 control based on addr2=Nothing but I'm not sure that would work. You could try it though and let us know how you make out.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I've tried hiding Addr2 and I 'think' that I'm doing it right and still not getting the results that I'm looking for.

    For the hidden expression I have: fields!Addr2.Value is nothing

    Perhaps that's where my problem is?

  • you need to actually return a true or false since the hidden property expects a boolean value.

    Something like

    =IIF(fields!Addr2.Value is nothing,True,False)

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I had that originally. But then I read somewhere, I believe on here, that the hidden property always takes the last option in the if statement...

    so in this case...

    =IIF(fields!Addr2.Value is nothing,True,False)

    it would always return false.

    ??

  • ummm... no.

    I use that logic quite frequently and it works for me. You just have to realize what you are passing. it might be helpful for you to temporarily put your IIF statement into a test textbox (or perhaps even into the addr2 section) that way you could verify the output and place the True and false accordingly.

    I suppose it also may have something to do with what you actually receive as a blank record. Do you get NULL, a zero length string '', or a padded string ' '? All Nothings are not the same.

    You could also play around with the IsNothing function You could try it with either of the following

    = IsNothing(fields!Addr2.Value)

    or

    = NOT IsNothing(fields!Addr2.Value)

    depending on what you need.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • just to show you where I got that information from...

    http://www.sqlservercentral.com/Forums/FindPost468368.aspx

    I've gone ahead and put everything into one expression and things are exactly how I want them. Thanks for the help!

    LSM

  • please disregard that information as it is incorrect. IIF works as advertised.

    Otherwise things like creating greenbar reports wouldn't work and a whole host of other SSRS hacks wouldn't work.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply