Basic Expression

  • Hello,

    I am using expressions for the first time in SSRS. Eventually i want to design a dashboard.

    I am testing an expression at the very basic level.

    I have added a text box on a report. I want the report text box to change colours on different inserts into a table.

    I have a table with fields: FirstName, LastName, BirthPlace.

    If I insert into a table and the BirthPlace is 'London' I want the box to turn RED.

    If i insert into a table and the BirthPlace is 'Edinburgh; I want the box to turn BLUE.

    So far ive added my textbox to the report. I have clicked F4. On the background colour of ii i have added the expression:

    =SWITCH (Fields!BirthPlace.Value = "London", "Red", Fields!BirthPlace.Value = "Edinburgh", "Blue")

    The report is set to refresh every 10 secords. I have added both London and Edinbugh to the tables yet i have not seen the colours change.

    Am i going wrong anywhere?

    Thanks

  • please check below link will help you fill up color

    http://www.codeproject.com/Articles/195017/SSRS-Series-Part-II-Working-with-Subreports-DrillD#13

  • You can use below expression in the background color property of BIRTHPLACE textbox.

    =IIF(Fields!BIRTHPLACE.Value = "LONDON","Red","Blue")

    I think it will help you.

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

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