Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Apply conditional formatting for a textbox in a matrix that contains an expression

$
0
0

I have a matrix that contains one row, and one of the columns in this row (a field ) contains an expression. I know this field is "Textbox24" but anyway, I have created a placeholder for this field and in Placeholder Properties I have given the label "PD". Note that the Value in this placeholder shows "Expr" because it contains an expression.

I don't think this is relevant, but just in case, the expression is:

=Code.GetPercentageDifferenceBetweenCurrentAndPreviousValue()

where GetPercentageDifferenceBetweenCurrentAndPreviousValue is custom code for the report which returns a decimal value. This works correctly in Preview mode.

I now want to apply conditional formatting on this field so the colour of the font changes depending on the value of the expression. I clicked on the text box of that field, and in Properties > Color > Expression > I entered

=IIF(Fields!PD.Value >= 50,"Green","Black")

When I go to Preview mode I get the error "The Color expression for the text box 'Textbox24' refers to the field 'PD'. Report item expression can only refer to fields within the current dataset scope or, if inside an aggregate, the specified data set."

I have tried a couple of other forms of the sytax for Fields!PD.Value but it doesn't work. Is my problem a syntax problem or a scope problem, and how do I solve it?

Thank you


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>