text align properties in details of table set depending on value

  • I have asked this on another forum and can not get an answer.

    I want specifically to have the text in a textbox in a the details section aligned left if it is like "RN" and Right if it is not.

    so it may look like

    | Office |

    RN100

    SE100

    TS100

    RN200

    RN100

    SE200

    so my expression is

    =iif(Fields!t_offc.Value like "RN*" , "Left", "Right")

    All I get is the text aligned as false, right.

    It appears that conditional formatting of the text align is not allowed.

    here is a link to the "OTHER" forum.

    http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3747310&SiteID=1

    Can you have conditional formatting of the text alignment?

  • Are you using RS 2000 or 2005?

    I have tried your solution in 2005 and it is working for me. Try trimming the string, maybe there is whitespace at the beginning of your string. I would also recommend that you use the Left function and use the = comparison. Like this:

    =iif(Left(Fields!t_offc.Value, 2).ToUppoper = "RN" , "Left", "Right")

    I also normally put code like this in a textbox on the report first to verify it is working as expected.

  • Hey Jack,

    I'm using SQL 2000 and visual Studio .Net 2003.

    I have tried the

    =iif(left(fields!t_offc.value, 2)="RN", "Left", "Right")

    also

    iif(Fields!t_offc.Value="RN100" , "left, Right")

    and niether of those works. I only get the false result.

    if I use

    iif(fields!t_offc.value like "RN*", "Bold", "Normal") or any of the other combinations in the fontweight properties it works.

  • Could be that in 2000 you can't set that property using an expression, but I find that hard to believe. I wish I could be of more assistance, but I don't have access to a 2000 server anymore. I can tell you it works in 2005.

  • Thanks for your help Jack.

    Is there a scale sytem in this forum to reward the members that help you out?

    If any one reading this is using 2000 and would like to test a conditional expression in the textalign properties it would be great!

    So if a value is present then left align if not the right align.

    Thanks so much.

Viewing 5 posts - 1 through 4 (of 4 total)

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