[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

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
0
apitech
Asked:
apitech
  • 2
1 Solution
 
Nico BontenbalCommented:
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now