Solved

Highlight a field based on value in another field in SSRS

Posted on 2016-09-02
4
39 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql server 2014 - Mobile apps 9 63
SCCM Reporting 5 61
SSRS Dynamic Column Names 3 65
Ssrs date parameters 12 89
Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
After much searching across the internet I have found that you could not set the name of the file you were attaching to dynamic report subscriptons in Microsoft Reporting Services. I did manage to find one article showing you how your could make a s…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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