Solved

Highlight a field based on value in another field in SSRS

Posted on 2016-09-02
4
36 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
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
DcpKing earned 500 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now