Changing the fontfamily value on the fly

  • Hi,

    I have a report that needs to have check box values displayed. As SRS doesn't have checkbox controls, I found a solution on a blog. This uses wingdings font ('o' is a blank square and x looks like a checked box). It's not an elegant solution but c'est la vie.

    The problem I have is that there is a third option I need to show. The three values are a checked box, an unchecked box and 'N/A'. For 'N/A', I need to set the font family to Arial and WingDings for anything else. So I have the following expression:

    =SWITCH(ISNOTHING(Fields!xxx.Value),"o",

    Fields!xxxl.Value= "True","x",

    Fields!xxx.Value= "N/A",Fields!xxx.FontFamily=("Arial"),

    Fields!xxx.Value= "N/A",Fields!xxx.Value,

    Fields!xxx.Value= "N/A",Fields!xxx.FontFamily = "WingDings")

    What I'm trying to do here is already have WingDings set in my properties, if my value is 'N/A' then set it to Arial and then set it back to Wingdings for the next time I run the report.

    This has no effect at all. I know I'm using the same condition three times. I just want to be sure this is possible before I continue.

    thanks,

    Paul

  • What property do you have the expression in?

    I would put this expression in the Font Family Property:

    IIF(Fields!xxx.Value = "N/A", "Arial", "WingDings")

    Then in the Value property of the TextBox:

    =SWITCH(ISNOTHING(Fields!xxx.Value),"o",

    Fields!xxxl.Value= "True","x",

    Fields!xxx.Value= "N/A",Fields!xxx.Value)

    See the attached image.

  • Thanks Jack,

    Yes, that's it.

    thanks,

    Paul

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

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