Adding Conditional Formatting
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Adding Conditional Formatting

You can design a report so that different styles are applied to items based on the data in the report. For example, you can display negative numbers in red or change the background colors on a table.

To make styles conditional, use an expression instead of a static value for the style properties of the item. For example, to make a text box render negative values in red for a field called Profit, open the Properties Window and use the following expression in the Color property:

=iif(Fields!Profit.Value < 0, "Red", "Black")

To alternate the background color for every other row in a tabular report, use the following expression in the BackgroundColor property of each text box in the detail row:

=iif(RowNumber(Nothing) Mod 2, "PaleGreen", "White")

You can build expressions based on a number of functions. For more information, see Using Expressions in Reporting Services.

© 2016 Microsoft