Conditional formatting in SSRS

  • Hi All, I am new to SSRS--please help me on following issue

    I have following Tablix in SSRS

    Portfoliotype Jan Feb

    A 1 2

    B 3 4

    I want to have different font based on my condition on given month

    On Jan if portfolio = A then I want red font....

    I am using following expression but I am not geyting any result...

    =iif(Fields!Portfoliotype.Value="A","red","green")

    where am i making mistake?

    Thanks

  • This looks okay - as long as you're doing it in the font color property?

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Also, be sure you are using it on the appropriate font color property. There's one for the row and one for the individual cells. I don't remember which overrides which when they are both set at the moment, but that may be the issue.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I want to do in individual cell...but its not working...I am putting expression on font...

    Thanks for all your help

  • So sorry, I wrote my previous post from memory, instead of checking in my SSRS environment. Instead of the font attribute, you want to use the color (aka foreground color) attribute of the control which contains the text you want to make red. This should be totally separate from the fonts, or at least it was in SSRS 2005 (all I have access to here at the office.)

    Right click the cell you want to change, click properties, select the color property and put in your expression. It might help to open it in the expression builder just in case so that if there is a syntax error it will show up with the red squiggly line...

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • IIRC the font color is case-sensitive so your expression needs to specify Red and Green, not red and green. HTH

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

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