none
show text change dependant on parameter value

    General discussion

  • I have a text box as a header showing in visual studio.  So far so good.

    A department wants a different header on the report from everyone else. 

    So I went into the text box, expression and created

    =IIF(Parameters!ClassID.Value=291, "Note

    1 depedant on date after 1st January

    2 depandant on date before 1st January

    3 depedant if there are bank holidays in the time frame ", "Note all dates are dependant on report")

    It works if I put all the information of the first part onto one line of text.  This is not what I want though and does not look correct for the end users. I want the text box to reflect the line breaks with each number starting a new line in the text box.  I wanted to know if there was a way of showing this in the expression box?

    For the moment I have created 2 text boxes and they are visible depedant on the parameter classID value, this is the only way I can get the text boxes to work in the current format. However I wanted to know if I was missing some ideas in the expresion box.  

    Wednesday, April 02, 2014 4:20 AM

All replies

  • I'm not sure if you are asking how you can add carriage-return(Line break). If yes - then you can format string by using VBCrlf constant.

    See code below

    =IIF(
    Parameters!ClassID.Value=291, "Note" & VBCrlf & 
    "1 depedant on date after 1st January" & VBCrlf & 
    "2 depandant on date before 1st January" & VBCrlf & 
    "3 depedant if there are bank holidays in the time frame", 
    
    "Note all dates are dependant on report")

    Wednesday, April 02, 2014 5:27 AM
  • Sorry for the late reply, I have actually been away from work, and only just returned.  That change has worked a treat for me.  Saved me a lot of hassle.

    Tuesday, April 15, 2014 9:58 PM