Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By : Abolfazl Radgoudarzi, Reza Rad
Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By: Abolfazl Radgoudarzi, Reza Rad

Overview of this book

Table of Contents (19 chapters)
Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – changing the background color of data rows based on expressions


In this example, we want to distinguish records for male and female customers by changing the background colors of the row. For this purpose, we will write an expression and use that in the background color property of the data row using the following steps:

  1. Go to the report designer of the Customer report from the previous example.

  2. Click on the row header for the details record (third row in the Tablix).

  3. In the Properties window, find the Background Color property and click on your desired color from the color picker menu.

  4. Choose Expressions from the color picker pop up as shown in the following screenshot:

  5. In the Expression editor window, enter the following script:

    =iif(Fields!Gender.Value="M","Light Green","Khaki")
  6. Close the Expression window and preview the report. You will see that male and female data rows are now different with regard to background color, as shown in the following screenshot:

What just happened...