Conditional Formatting on a Formula in SQL Reporting Services 2008

Hello:

I have a field containing a formula.  I know that SQL Reporting Services offers conditional formatting, where you can have a field display as Red when the field is less than 0.  But, how do you do that when the field is a formula?

Here is the formula:

=Sum(iif(Fields!SOPTYPE.Value=4,
-Fields!XTNDPRCE.Value,
Fields!XTNDPRCE.Value))

This formual is a sum based ono a grouping.

I went into the Placeholder properties and then in the Font section and clicked the function button.  Then, I entered the following:

=iif(Sum(iif(Fields!SOPTYPE.Value=4,
-Fields!XTNDPRCE.Value,
Fields!XTNDPRCE.Value))) < 0, Red, Black

But,I got an error upon running the report with this.

How do you do this conditional formatting when there is a formula.  I know that this would work with a regular field.

Thanks!

Apitech
LVL 1
apitechAsked:
Who is Participating?
 
Nico BontenbalConnect With a Mentor Commented:
Try:
=iif(Sum(iif(Fields!SOPTYPE.Value=4,
-Fields!XTNDPRCE.Value,
Fields!XTNDPRCE.Value)) < 0, "Red", "Black")
0
 
apitechAuthor Commented:
LOL!  I didn't think about the placement of the parentheses!

You're right, as usual!

Thank you, Nicobo, for getting me out of yet another debacle!!!

John
0
 
apitechAuthor Commented:
Nicobo is an asset to Experts Exchange!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.