Specifications
Layout Control CHAPTER 9 171
FIGURE 9-6 Changing report variables
To write to your report variable, you use the SetValue method of the variable. For example,
assume that you have set up the report to insert a page break between group instances, and
you want to update the execution time when the group changes. Add a report variable to the
report, and then add a hidden text box to the data region with the group used to generate
a page break. Next, place the following expression in the text box to force evaluation of the
expression for each group instance:
=Variables!MyVariable.SetValue(Now())
In the previous version of Reporting Services, the report variable type was a value just
like any text box on the report. In SQL Server 2008 R2, the report variable can also be a .NET
serializable type. You must initialize and populate the report variable when the report session
begins, then you can independently add or change the values of the report variable on each
page of the report during your current session.
Layout Control
SQL Server 2008 R2 Reporting Services also includes several new report item properties that
you can use to control layout. By using these properties, you can manage report pagination,
ll in data gaps to align data groupings, and rotate the orientation of text.