An expression to change the text color of a specific value in a value string in SSRS based on another field

I have a field in my SSRS report that contains a string of numbers separated by commas (from a coalesced selection in SQL). It looks like 12, 91, 160, 171, 223. I would like to change the text color of only one specific value (for example, 160) if this value is also in a different report field.

I already have this expression for the field properties font.

=iif(Fields!Store_Number.Value.ToString().Contains (Fields!DMHomeStore.Value)= True,"Red","Black")

This changes the text color of the entire field, not just one value per line.

Basically, if DMHomeStore= 160 and Store_Numberhas 160 lines in it, then enter only 160 red in the Store_Number line.

+3
source share
2

, , , .

  • .
  • → →
  • , Value → ,
  • "" "HTML", HTML
  • ""

. , , , , HTML, .

  • :
=Replace(Fields!Store_Number.Value.ToString(),Fields!DMHomeStore.Value," `<span style='color:red'>` " & Fields!DMHomeStore.Value & "`</span>`")

, , . , .

+5

Source: https://habr.com/ru/post/1756270/


All Articles