Specifications
Expression Language Improvements CHAPTER 9 169
FIGURE 9-4 Aggregation of an aggregation
Here is the expression for the value displayed in the Monthly Average row:
=Avg(Sum(Fields!SalesAmount.Value,"EnglishMonthName"))
Conditional Rendering Expressions
The expression language in SQL Server 2008 R2 Reporting Services includes a new global
variable that allows you to set the values for “look-and-feel” properties based on the render-
ing format used to produce the report. That is, any property that controls appearance (such
as Color) or behavior (such as Hidden) can use members of the RenderFormat global variable
in conditional expressions to change the property values dynamically, depending on the
rendering format.
Let’s say that you want to simplify the report layout when a user exports a report to
Microsoft Excel. Sometimes other report items in the report can cause a text box in a data
region to render as a set of merged cells when you are unable to get everything to align
perfectly. The usual reason that users export a report to Excel is to lter and sort the data,
and they are not very interested in the information contained in the other report items.
Rather than fussing with the report layout to get each report item positioned and aligned just
right, you can use an expression in the Hidden property to keep those report items visible in
every export format except Excel. Simply reference the name of the extension as found in the
RSReportServer.cong le in an expression like this:
=iif(RenderFormat.Name="EXCEL", True, False)