?
Solved

Highlight a field based on value in another field in SSRS

Posted on 2016-09-02
4
Medium Priority
?
70 Views
Last Modified: 2016-09-03
I have a request on a report to highlight a value in one field based on a value from another field, is that possible in SSRS?

They would like the have the "ACFD Level Of Service" value of "Cancelled - PTA or At Scene - No Pt Contact" either highlighted or text color in red if the "PPlus Arrival Time (Min)" value is greater that 5.00 Min.

Sample of Fields
0
Comment
Question by:srodgers45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
DcpKing earned 2000 total points
ID: 41782952
Hi!
Here's an example of how to set the background colour of a cell in a tablix depending on the content of another cell
The first screenshot shows you what we want to end up with - the employee ID with a background of red if the employee minutes are zero
The second shows the tablix being edited - I've right-clicked on the cell I want to change colour and chosen Text Box Properties from the menu.
        I've then chosen the Fill page within this dialog. What I'm going to do is click on the fill color expression button, labeled fx.
The third screenshot shows you the expression I've used.
= iif(fields!Minutes.value = 0, "Red", "No Color")

Open in new window

Remember that:
1. you must start the expression with an equals sign!
2. iif takes three arguments - the control (a boolean expression), the result if the control is true, and the result if the control is false
3. "No Color" means just base transparent, so if you have an image behind your tablix then it'll show through
4. For the Control you have to refer to the other field's value, hence the ".value"

Hope this gets you on your way

Mike
PS This was done using SQL Server 2012. The language has not, I believe, changed, but if this doesn't work then please ask!
Screenshot-from-2016-09-03-09-47-07.png
Screenshot-from-2016-09-03-09-47-44.png
Screenshot-from-2016-09-03-09-48-08.png
0
 

Author Comment

by:srodgers45
ID: 41783024
Thanks for your time, however that fills all values in the "ACFD Level of Service" columns, I only want to fill if the "PPlus Arrival Min" is greater than 5.00 min and the actual value (Text) for level of service is "Cancelled - PTA or AT Scene - No Pt Contact"  is there a way to do that?

Thanks again!
0
 

Author Closing Comment

by:srodgers45
ID: 41783095
I was able to figure out the rest of what I needed from what you sent. I have another related question, I will post it separately. Thanks
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 41783186
Sorry! I was out shopping when you replied, so didn't see the second part of the question. It should have been something very similar to
= iif( (Fields![PPlus Arrival Min].value > 5.00 and Fields![Level of Service].value = "Cancelled - PTA or AT Scene - No Pt Contact"), "Red", "No Color")

Open in new window


but well done on getting it to work!

Hope this all helped

Mike
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question