Exercise: Expressions - director age and conditional format

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the Wise Owl course listed below!

Category ==> SSRS Reporting Services  (53 exercises)
Topic ==> Expressions  (2 exercises)
Level ==> Harder than average
Course ==> Reporting Services
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Create a new report, and within this a dataset listing the following columns:

  • DirectorName (from the tblDirector table)
  • DirectorDob (from the tblDirector table)
  • FilmName (from the tblFilm table)
  • FilmReleaseDate (from the tblFilm table)

Apply a criteria to show only directors of films winning exactly 3 Oscars - this should give 4 rows.

Create a report to include an expression giving the age of each director at the time a film was released (see hint below), with a subtotal at the bottom showing the average director's age:

SQL Server Reporting Services 2008 R2 exercise - Expressions (image 1)

If you are over 40, your chances of directing a film may be slipping away

Use the expression builder to create the formula: =DateDiff("yyyy",Fields!DirectorDOB.Value,Fields!FilmReleaseDate.Value)

Apply conditional formatting so directors aged over 50 appear crossed out:

SQL Server Reporting Services 2008 R2 exercise - Expressions (image 2)

Set the TextDecoration property to LineThrough if the director is over 50

Save this report as Another door closes, then close it down.

This page has 0 threads Add post