Solved

highlight, turn bold field based on condition in another field

Posted on 2014-07-23
2
692 Views
Last Modified: 2014-08-01
I have a report with a column numeric name: cost change.

I would like to highlight and turn the font to bold in some cells when the value in cell cost change fluctuates +/- 2 cents.

Is there any chance someone can show me how the IIF would need to be coded?

Thank you.
0
Comment
Question by:metropia
2 Comments
 

Author Comment

by:metropia
ID: 40215613
I have this expression that does not work how I want it to work:

CASE
    WHEN (SUM(FavUnfavCostChange) < (2/100) THEN 'Less'
    WHEN SUM(FavUnfavCostChange) > (2/100) THEN 'More'
    ELSE NULL
END AS 'Flag'

But I get:

0.00000815000000000000            More    -- this is not more than 2 cents, is just a positive number
-0.00094700000000000000            Less     -- this is not less than 2 cents, is just negative number
-0.00222000000000000000            Less     -- this is not less than 2 cents, is just negative number
-0.00012250000000000000            Less     -- this is not less than 2 cents, is just negative number
0.00000000000000000000            NULL    -- this is zero so null is fine
0.01188576000000000000            More    -- this is not more than 2 cents, is just a positive number
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 305 total points
ID: 40216534
Since the only topic in this question is MS SQL Reporting, assuming this is in SSRS, you can edit the text properties by clicking on the text box, then right-click:Text Box Properties, then...

Fill Color, hit the fx button to the right of the Fill Color combo box, and in the Expression Editor enter this expression
=IIF(ABS(Fields!COST_CHANGE.Value) > .02, Yellow, White) 

Open in new window

... and Font, hit the fx button to the right of Bold, and in the Expression Editor enter this expression
=IIF(ABS(Fields!COST_CHANGE.Value) > .02, True, False) 

Open in new window

Change the name of the column, Yellow to whatever color floats your boat, and if  'cost change fluctuates +/- 2 cents.' means anything other than the absolute value of that column being greater than .02, we'll need to work with the expression.
0

Featured Post

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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