Skip to main content

Style set by expression

Comments

6 comments

  • Ryan Cooney

    Yes, you are able to set styles, background colors, and all sorts of appearance settings using expressions.

     

    Have a look at this Tech Tip video (around the 5 minute mark) to see something pretty close to what you described.

     

    --Ryan

    0
  • Jake Brown

    Thanks Ryan, great video! How do I tell what colors are available? It doesn't seem to like Red can I use some format of RGB string?

     

    Iif( [milestone_result] = 'Checksheet', 'Red', [milestone_result] = 'Approved', 'Green', 'Black' ) 

    0
  • Ryan Cooney

    Hi Jake,

     

    'Red' works for me.

     

    Under the hood it is .NET so any system defined color name should work. See https://docs.microsoft.com/en-us/dotnet/api/system.drawing.color?view=net-5.0#properties.

     

    There are also built-in Rgb(red, green, blue) and Argb(alpha, red, green, blue) functions that accept numbers between 0 and 255 for the values and produce valid colors.

     

    --Ryan

    0
  • Jake Brown

    Thanks Ryan, that helped me narrow down my problem. For some reason the = operator was not working for me for Checksheet variable, "contains" method did the trick.

     

     Iif(Contains([milestone_result], 'Checksheet'), 'Green',Contains([milestone_result], 'Approved'), 'Red', 'Black')

    0
  • Claire Inbody

    Jake - I am running across a similar issue, but I cant get my example to work:

    Iif(Contains([SCOMNAME] , 'Finescale Dace') , [DataSource.RowCount], False )

    where I want to show the count of the string if my field [SCOMNAME] contains Finescale Dace. Any help much appreciated!

    Claire

    0
  • Jake Brown

    @Claire Inbody?  I think you would want just just switch the logic to be in the visible section rather than appearance. I have a similar example that may help you...visible

    0

Please sign in to leave a comment.