Solved

conditional formatting with nulls.

Posted on 2013-06-25
3
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack.  Those functions are IIF() and Switch().  And I'll be showing you how easy it is to add an Else part to the Switch function. T…
Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

617 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