SSRS REPORTING SERVICES EXERCISES▼
- Designing a Simple Report (3)
- Data sources and datasets (1)
- Tables (5)
- Grouping tables (6)
- Expressions (8)
- Pages and printing (2)
- Parameters (15)
- Indicators (3)
- Gauges (4)
- Matrices (5)
- Charts (6)
- Data bars and sparklines (2)
- Lists (4)
- Subreports (2)
- Revision of expressions (3)
- Variables (3)
- Embedding code (3)
- Basic Custom Assemblies (2)
- Examples of custom assemblies (1)
- Customising reports (2)
- Using SQL views (3)
- Stored procedures in SSRS (2)
- Stored procedure parameters (2)
- Dropdowns with procedures (3)
- Multivalue parameter procedures (1)
- Improving report navigation (2)
- Linking reports (drilldown) (4)
- Dynamic reports (2)
SSRS Reporting Services | Examples of custom assemblies exercise | Create a heat map using a custom assembly
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.
You can learn how to do this exercise on the relevant Wise Owl classroom training course (sadly for the moment only in the UK).
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.
The aim of this (longer) exercise is to create a heat map of the number of Oscar wins for each film (excluding those which didn't win any Oscars).
|We'll turn this ...||... into this|
The first stage is to create the report on the left above (call it Heat Map), listing the films alphabetically.
Now create a report variable to hold the maximum number of Oscars won (it's actually 11 - you could create a textbox to show this value for debugging purposes):
You could create a textbox just to check that your report variable is returning the correct value.
Now set the fill colour for each detail row of your table to be an expression like this:
Write a function to make this work, using these thoughts to help you:
- You need to work out a percentage of the total colour strength to use for each film (eg if a film wins 3 Oscars, it should be colours (3-1) / (11-1) percent of the total possible strength = 20%).
- You then need to translate this into a hexadecimal code. In VB the hex function will do this; in C# you can use ToString("X") to get the same thing.
- Finally, you need to ensure that this string is 2 characters long, then concatenate it with other characters to get a string in the range #000000 (black) to #FFFFFF (white).
If you want to reproduce the report at the start of this exercise, use #FFABAB, where AB is the 2-character code corresponding to the number of Oscars won.
Close your report down (if you have any spare time, you could always look at the even more complicated example in the course manual).