Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sergeant_time
Yak Posting Veteran
73 Posts |
Posted - 2010-07-01 : 12:39:21
|
Hello,I have a conditonal format in my report layout that changes the text color when the Value > 10. The expression works, but not correctly. My goal was to change the text color to red (>10) or green (<10). It does not change the color correctly. It either remains red or green regardless if the value is less than or greather than 10. =Iif(((FIELDS!Q1_Excellent.Value) + (FIELDS!Q1_DontKnow.Value) + (FIELDS!Q1_Poor.Value) +(FIELDS!Q1_Fair.Value)+ (FIELDS!Q1_Neutral.Value)+ (FIELDS!Q1_VeryGood.Value))<>0,IIF((((Fields!Q1_Poor.Value + Fields!Q1_Fair.Value))/((FIELDS!Q1_Excellent.Value) + (FIELDS!Q1_DontKnow.Value) + (FIELDS!Q1_Poor.Value) +(FIELDS!Q1_Fair.Value)+ (FIELDS!Q1_Neutral.Value)+ (FIELDS!Q1_VeryGood.Value)))< 10.0,"Red","Green"),"Black") |
|
X002548
Not Just a Number
15586 Posts |
|
sergeant_time
Yak Posting Veteran
73 Posts |
|
Sachin.Nand
2937 Posts |
Posted - 2010-07-01 : 13:02:20
|
Shouldn't it be this way....(FIELDS!Q1_VeryGood.Value)))> 10.0,"Red","Green"),"Black") Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
sergeant_time
Yak Posting Veteran
73 Posts |
Posted - 2010-07-01 : 13:08:10
|
:(, I tried this prior to posting. When I select my parameters and get my results it just do the oppossite. Regardless if its greater than or less than 10, changes the text to green. quote: Originally posted by Idera Should it not be this way=Iif(((FIELDS!Q1_Excellent.Value) + (FIELDS!Q1_DontKnow.Value) + (FIELDS!Q1_Poor.Value) +(FIELDS!Q1_Fair.Value)+ (FIELDS!Q1_Neutral.Value)+ (FIELDS!Q1_VeryGood.Value))<>0,IIF((((Fields!Q1_Poor.Value + Fields!Q1_Fair.Value))/((FIELDS!Q1_Excellent.Value) + (FIELDS!Q1_DontKnow.Value) + (FIELDS!Q1_Poor.Value) +(FIELDS!Q1_Fair.Value)+ (FIELDS!Q1_Neutral.Value)+ (FIELDS!Q1_VeryGood.Value)))> 10.0,"Red","Green"),"Black") Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH
|
 |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2010-07-01 : 13:19:26
|
I woult no embed this long code just for conditional formatting. can you not do this in your stored proc that is called by the report. there you do the ifs as CASE statements. then you can specify colors there, even color code. SELECT CASE WHEN X <> 0 THEN 'Red' (or #FF0000) CASE WHEN x > 10.0 THEN 'Green' (or #408080) ELSE 'Black'FROM xwhat if tomorrow you want to add aqua color, are you gonna come into the report and mess with this long code again. IMHO best to break this out to the called sproc.<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|
|