how to change a color of particular word in the row in ssrs reports
-
hi.. i've created an report in which i want to change the color of the particular word i've four words which i want to change the color john,steve,mike,and danial.. for these name where ever they appear in the row the color should change is it possible.. ??
-
hi.. i've created an report in which i want to change the color of the particular word i've four words which i want to change the color john,steve,mike,and danial.. for these name where ever they appear in the row the color should change is it possible.. ??
Hi, You can use BackgroundColor-property to change the color and define an expression how the color is set. What comes to the color itself, you can for example resolve the color in the formula or add an extra field to your query which defines the color, like:
SELECT ...
CASE
WHEN LOWER(table.NameField) LIKE '%john%' THEN 'Red'
WHEN LOWER(table.NameField) LIKE '%steve%' THEN 'Blue'
...
ELSE 'White'
END AS BackgroundColor,
...
FROM ...Now each row should have a color field which you can use in the expression for the BackgroundColor-property. If you want to do this in more elegant way you can create a table for the name/color pairs and use that table for lookups and possibly create a small T-SQL function for the logic.
The need to optimize rises from a bad design.My articles[^]