SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Basic Expression


Basic Expression

Author
Message
dbman
dbman
Say Hey Kid
Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)Say Hey Kid (673 reputation)

Group: General Forum Members
Points: 673 Visits: 1537
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
raj87
raj87
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
Points: 29 Visits: 64
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
THE-LIP
THE-LIP
SSC-Enthusiastic
SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)

Group: General Forum Members
Points: 117 Visits: 30
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search