Tuesday 28 January 2014

SSRS: Creating a Report variable or Group variable

Creating a Report Variable

To get round the problem above, we'll create a report variable to hold the title.  Since this will be calculated once and once only (when the report first loads), we'll get the same time on every page.  First go to the report's properties:
Short-cut report properties menuTop report properties menu
Either right-click on the report edge …… or use the top menu
Next, choose to add a variable:
Report variables tab
Click on the Variablescategory, then choose to add one.
Give your new variable a name, then click to create an expression for it:
Naming a variable
Here we've called the variablerepTitle.
It's a good idea to prefix all report variable names with rep, so as not to confuse them with group variables (all variable names must be unique).
Referring to a report variable:
=Variables!repTitle.Value


Creating a Group Variable 

To create a group variable, first display the properties of the DirectorName group: 
Displaying group properties
There are many ways to do this: one way is to right-click on the group in the grouping pane and choose to show its properties.
Now add a group variable as you did for the report variable earlier:
Adding group variable
The expression is: =Sum(Fields!FilmOscarNominations.Value)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home