Solved

SSRS - Conditional Formatting

Posted on 2013-12-11
8
995 Views
Last Modified: 2013-12-20
I am having problems applying conditional formatting to a single column within a column group of a matrix.

The Matrix is very Simple and the results of it can be seen below.

Matrix Results
The Columns "overdue" and "within SLA" are part of the column group "SLA_Status"

I need the numbers that are greater than 0 in the overdue column only to be formatted in red.

I am able to have all the numbers in the Column group formatted red by applying this expression =IIf(CountRows() = 0,"Black","Red") but I can't work out how to apply that only to one column in the column group.

All advice very much appreciated.

Pat
0
Comment
Question by:EnsingerIT
  • 4
  • 3
8 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39711295
You can refer to a textbox through the ReportItems collection.  So assuming the textbox that displays the numbers is called Overdue, the expression would look like this:

=IIf(ReportItems!Overdue.Value = 0,"Black","Red")
0
 

Author Comment

by:EnsingerIT
ID: 39711412
Thanks or your advice!, the Report Items collection is called "SLA_Staus" it is a column group on this Matrix, It has one of two possible values, being either "overdue" or "Within SLA"

The values in the overdue column above are a count of the number of calls that are assigned to a technician that are either overdue or within the SLA.

Given that the Column "overdue" is dynamically created by the matrix column grouping, I don't think I can refer to it by it's report item collection...

Though I'm VERY new to this and may be wrong.

Pat
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39711479
Even in a matrix it should be possible.  To find its name, select the textbox by clicking it and then look at the Name property in the Properties screen. That's the one to use in the expression.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:EnsingerIT
ID: 39713476
Hi,

I'm really sorry about this I'm not trying to be dim, but this is all pretty new to me.

below is a shot of how the matrix looks in design mode... I'm not sure where I find the properties of the "overdue" column.

design view
Thank you for your advice so far!

Pat
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39713484
"I'm really sorry about this I'm not trying to be dim, but this is all pretty new to me."

No worries, I like a challenge :)

Thanks for the screenshot, that makes it easier to explain.  And indeed, if the coloring only applies to the Overdue column then the expression needs to get enhanced.

"Overdue" and "Within SLA" are two values of SLA_Status, right?  So you can take that into account in the expression:

=IIf(ReportItems!Overdue.Value > 0 and Fields!SLA_Status.Value = "Overdue","Red","Black")

Open in new window

This expression assumes the textbox is called Overdue.  Your screenshot shows the SLA_Status header textbox as selected.  The one to which the expression should refer is the white one right beneath it.
0
 
LVL 27

Expert Comment

by:planocz
ID: 39718230
Did I miss this in the reading above?

the expression has to be in the textbox windows properties color box.
0
 

Accepted Solution

by:
EnsingerIT earned 0 total points
ID: 39720982
I Finally solved this with this equation on the textbox field.

=IIF(Fields!SLA_Status.Value = "True" and CountRows() > 0,"IndianRed","PaleGreen")

I had used a case statement in the original SQL Query, to display "Overdue" or "within SLA" and that I think was the route of my problem.

Pat
0
 

Author Closing Comment

by:EnsingerIT
ID: 39731408
It's my own solution...
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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

685 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