Solved

Highlight a field based on value in another field in SSRS

Posted on 2016-09-02
4
24 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Steps to solve SSRS SQL 2008 R2 User Access Control (UAC) Permission Error With the introduction of SQL Server 2008 R2 and Vista (Windows 7 as well) came new enhanced security features. One of the features included was User Access Control (UAC) t…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

11 Experts available now in Live!

Get 1:1 Help Now