Solved

conditional formatting with nulls.

Posted on 2013-06-25
3
344 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS 2008 using rectangles with text boxes 6 79
SSRS Expression 2 43
SSRS 2012 URL 11 66
SQL Server query - can a #temp table be improved with indexing? 6 43
Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

837 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