Changing color in a SSRS Field using expression

Posted on 2014-02-24
Last Modified: 2014-03-02
We currently have a report called Inventory Planning.  It basically lists all current inventory, out of stock inventory with open sales orders, and out of stock inventory with open Purchase Orders.

What our buyers face is when they purchase goods  for orders that do not have inventory, the customer will cancel the order (for whatever reasons) ad then we are stuck with inventory we may not necessarily want.  They have told me 98% of the time these orders get cancelled are with brand new customers.

Their question- can we change the font color of the customer if they have never done business with us,

Request seemed simple enough.  I wrote a view of current active customers that have never had been invoiced.

Now the fun part- how do I get SSRS to compare the customer field in the report to my view to change colors?

Any and all help will be appreciated.

Question by:sbalawajder
  • 3
LVL 37

Expert Comment

ID: 39884860
Is it an option to (LEFT OUTER) join your view in the query that fetches the data for the report?  Or does it reside in another database?

Author Comment

ID: 39885660
I used a left outer join to bring it into the query. The only problem is comparing it to the customer the order happens to be written up to (which can vary by inventory id)

Accepted Solution

sbalawajder earned 0 total points
ID: 39885714
OK, I about got this figured out.

I LEFT OUTER joined in the view, and I'm selecting on it via a new column


I then put this expression in:

=IIf(Fields!ID.Value = 0, "Black","Red")

Seems to do the trick, just need to verify it's working properly.

Author Closing Comment

ID: 39898374
Figured it out on my own

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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 Designer 19 40
convert null in sql server 12 33
Loop through SQL parameters and insert to temp table? 4 38
SQL Query Help Top 1 and Distinct? 6 22
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

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