views:

859

answers:

1

In SQL Reporting Services 2008, can you format a field conditionally? In Crystal Reports it is doable. I have a field which I want to be bold if another field is Y, and unbold if its value is N.

+5  A: 

Use the FontWeight property of the field, and set it to an expression like this:

=iif(Fields!YourTestField.Value="Y","Bold","Default")

You can find FontWeight in the properties pane for the report item, or under Font -> Style -> Bold in the properties dialog (right click -> properties). Use the f(x) button to edit the formula.

Peter
For anyone else coming across this note that you can also conditionally format text mid-string within SSRS 2008. You CANNOT do this in SSRS 2005, in 2005 you can only format the whole text box.
Joel Mansford
I didn't know about this (or the placeholder feature) till I read your comment and tried it out. Perhaps you could provide an another answer, eg, highlight text -> properties pane -> etc.
Peter