Solved

SSRS - Conditional Formatting

Posted on 2013-12-11
8
974 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

777 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