question

KazHeath avatar image
KazHeath asked

Changing Text cell colour in RDL Files

Hi I have an RDL report file that compares several figures with benchmark figures. If the actual figure falls below the benchmark, I want the actual figure to display in red text. I have managed this for most of the cells, but there are a couple of cells that are calculated within the RDL. For these cells, I am struggling to get the IIF statement to work correctly. ***An example that works:*** =Iif(Parameters!CompareGroup.Value = True and (Fields!TotDaysUsed.Value/Fields!TotBkgsEnded.Value) < Parameters!FranAvgLoan.Value, "red", Iif(Parameters!CompareGroup.Value = False and (Fields!TotDaysUsed.Value/Fields!TotBkgsEnded.Value) < Parameters!GrpAvgLoan.Value, "red", "black")) ***And one that doesn't (I'm assuming the second IIF is a problem)*** =Iif(Parameters!CompareGroup.Value = True and iif(sum(Fields!cappeddays.Value)+sum(Fields!uncappeddays.Value) = 0, 0, sum(Fields!cappeddays.Value)/(sum(Fields!cappeddays.Value)+sum(Fields!uncappeddays.Value))) < Parameters!FranFreeDays.Value, "red", Iif(Parameters!CompareGroup.Value = False and iif(sum(Fields!cappeddays.Value)+sum(Fields!uncappeddays.Value) = 0, 0, sum(Fields!cappeddays.Value)/(sum(Fields!cappeddays.Value)+sum(Fields!uncappeddays.Value))) < Parameters!GrpFreeDays.Value, "red", "black")) Thanks for reading - hope someone can help!
formattingrdl
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

do you get an error? What happens with the code you have ...?
0 Likes 0 ·
Hi No, I don't get any errors, it just doesn't alter the text colour when the actual figure falls below the benchmark. All the data populates as it should - it's just the wrong colour!!! It's very frustrating.
0 Likes 0 ·
Blackhawk-17 avatar image
Blackhawk-17 answered
Try a SWITCH expression instead of an IIF statement. Here's a snippet: =Switch(Fields!Cache_Hit_Ratio.Value >= 96.5, "Green", Fields!Cache_Hit_Ratio.Value >= 90, "Yellow", Fields!Cache_Hit_Ratio.Value < 90, "Red") It helped me get around almost the exact same issue...
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KazHeath avatar image
KazHeath answered
Hi Just to make this easier to do I actually manipulated the SQL that returned the data. I split all my data up in to smaller tables (rather than just one) and used cross joins to return my results. This meant that most of the figures were the same and therefore I was able to do this a totally different way. I know this probably doesn't make much sense without seeing the data, but thanks for looking and I've sorted it out now. Kaz
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.