Link to home
Start Free TrialLog in
Avatar of J C
J CFlag for United States of America

asked on

Question related to conditional formatting inside of a Matrix report(SSRS)

One of the columns in my matrix is TaskCode. I want to change the way a specific column appears if it's the taskcode Trusses. So if the TaskCode.Value = 'Trusses' change the color. I am new to SSRS and am wondering if this is possible and if so, where and how the expression should be constructed.

Thanks for any help you can provide!
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of J C

ASKER

Thanks a lot! If I want to apply conditional formatting to other taskcodes, would I just add another IIF on the line below? Do they have to be separated with a comma?
Avatar of J C

ASKER

I am receiving this warning as well. My formula's are working as expected. I am not sure where this warning is being generated from.

Warning      1      [rsInvalidColor] The value of the Color property for the textrun ‘description.Paragraphs[0].TextRuns[0]’ is “Rim”, which is not a valid Color.      C:\Users\administrator.mydomain\Documents\Visual Studio 2008\Projects\ScheduleTrackingMatrix\ScheduleTrackingMatrix\Schedule Tracking Matrix.rdl      0      0
Avatar of J C

ASKER

Can you apply multiple conditions for formatting to a single textbox?

For example. I currently have an expression for my actualenddate row where if taskcode.value = "trusses", "white". "black". This works great. What if I want to make the font color green if the actualenddate.value <= plannedenddate.value for all taskcode's other than trusses is that possible? I want to leave trusses alone and leave the formatting as white but for all other's I want to be able to base the font color on other conditions. Let me know!

Thanks!
>Can you apply multiple conditions for formatting to a single textbox?
Yes, you'll have to daisy-chain/nest the IF statemnts, like this...

=IIF(Fields!TaskCode.Value = "Trusses", "Red", IIF(Fields!TaskCode.Value = "Bananas", "Yellow"), "Black")

Not sure if there is a SELECT CASE / IF .. ELSE way to handle multiple values more gracefully.
Avatar of J C

ASKER

=IIF(Fields!taskcode.Value = "Trusses", "White", IIF(Fields!actualenddate.Value <= Fields!actualenddate.Value, "Green"), "Red")

So in theory the above should work? Both dates exist inside of my dataset but it throws me an error when I try to use the above statement.

I attached the SS with the error.
error.png
Avatar of J C

ASKER

I changed it so that the second actuanenddate is actually planstardate
Avatar of J C

ASKER

Let me know if you can see what I am doing wrong.

Thanks for all your help!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of J C

ASKER

Thanks a lot!
Thanks for the grade.  Good luck with your project.  -Jim