Hide Text Box If Value Is Blank move the text underneath up one

  • Hi,

    I am creating a report which is just an A4 sheet with a quote.

    The information on the quote is retrieved from a SQL view.

    The Quote has the company logo, customer name and address and details of the work being quoted for.

    What I need to be able to do is on the address part. If, for instance, line 3 of the address is empty then the text box with line 3 address details must not be displayed and the text box with line 4 of the address (provided thats not empty) will display where line 3 would normally be.......In other words if any lines of the address have no data, instead of the address appearing with gaps where there are no details, I want the address to appear one line under the other with no gaps

    Anyone have any idea how I can accomplish this?

    Thanks in advance
    Paul.

  • I think I may have answered this myself

    Each text box that the address details are in, number them in order of the addresslines (textbox1, textbox2 etc...)

    Put this formula into each textbox visibilty properties to hide it if it has a NULL or blank value.....

    =iif(Fields!anyfield.Value is nothing or Fieldsanyfield.Value ="", true, false)

    Now put all the cells on top of each other.

    I've had limited time to test it but it seems to be working

  • paul 69259 - Thursday, June 1, 2017 11:11 AM

    I think I may have answered this myself

    Each text box that the address details are in, number them in order of the addresslines (textbox1, textbox2 etc...)

    Put this formula into each textbox visibilty properties to hide it if it has a NULL or blank value.....

    =iif(Fields!anyfield.Value is nothing or Fieldsanyfield.Value ="", true, false)

    Now put all the cells on top of each other.

    I've had limited time to test it but it seems to be working

    I'd have to wonder what you would see if there are multiple address lines and the position of all the text boxes is right on top of each other, which to me means that they all occupy the exact same location.   That may not be what you mean.   There's a much easier way to do this.   Simply create an expression that takes NULL values into account and constructs all the address lines, including the carriage return and line feed, into a single value, and let that occupy a single text box.

Viewing 3 posts - 1 through 2 (of 2 total)

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