Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SSRS - Conditional Formatting

Posted on 2013-12-11
8
Medium Priority
?
1,058 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
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.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

971 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