Exercise: Report with alternating row colours and flashing

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 ==> Report Builder 3.0  (42 exercises)
Topic ==> Expressions  (5 exercises)
Level ==> Harder than average
Course ==> Report Builder
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.

Open the report called The Directors in the above folder (or a version of the report that you have created yourself).  You may need to edit the data source of the report so that it points to the correct connection.

Amend the report so that alternate rows appear shaded:

Report Builder 3.0 exercise - Expressions (image 1)

See the notes below for how to achieve this effect

To make this work, note that RowNumber(Nothing) will give the row number of the current row - the Nothing signifies that you're taking the row number over the entire table, not some limited scope within it - and that 17 mod 3 equals 2, for example (ie you can use mod to calculate the remainder when you divide one number by another).

Too easy?  Set the Autorefresh property of the report to 1, and it will refresh itself automatically every second.  You can then set the background colour of the report to an expression which gives a different colour every second:

Report Builder 3.0 exercise - Expressions (image 2)

You may find the CHOOSE and SECOND functions useful to accomplish this

Save this report as Flashy Report, and go back to design view before you hurt your eyes!

This page has 0 threads Add post