Solved

conditional formatting with nulls.

Posted on 2013-06-25
3
331 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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
where clause for ssrs parameter 1 28
Optimization of SQL Stored Procedure 7 67
MS SSRS scale out 13 64
Report Builder 3.0 3 9
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now