Solved

conditional formatting with nulls.

Posted on 2013-06-25
3
337 Views
Last Modified: 2013-06-26
I'm trying to change the background color of a textbox based on values. Right now I have values that have nulls but I can't seem to get that to work. I want the background to be white if null. This is what I have tried so far.

=SWITCH(Fields!field1.Value < 90,"Red",
Fields!field1.Value = "","white",
Fields!field1.Value is nothing,"white")
0
Comment
Question by:NickMalloy
3 Comments
 
LVL 12

Expert Comment

by:duttcom
ID: 39276661
Try this instead -

=IIF(IsNothing(Fields!field1.Value), "White", "Red")

This will set the background to white if field1 is empty and red if it contains a value.
0
 

Author Comment

by:NickMalloy
ID: 39278359
It can't be read for any value. It has to be red only if the condition applies. I tried this and it still colors red when the item is blank.

=SWITCH(Fields!Field1.Value < 85,"Red",
IsNothing(Fields!Field1.Value), "White")
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 300 total points
ID: 39278891
The Switch function evaluates from first to last expression, this should have a better result:

=SWITCH(IsNothing(Fields!Field1.Value), "White",
  Fields!Field1.Value < 85,"Red")

If that still doesn't work, try this:

=IIF(IsNothing(Fields!Field1.Value), "White",
  Switch(Fields!Field1.Value < 85,"Red", true, "White"))
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
SSRS Graph - Stacked Bar 2 55
SSRS Dynamic Date Parameter 25 364
Ssrs date parameters 12 89
SQL Server Communications Audit 5 92
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

773 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