2.341.6.12 Restrictions on Use of Global Collections

The Fields, Parameters, ReportItems, and Globals collections have restrictions on the contexts in which they can be used in expressions. The following table specifies where these global collections can ("Yes," or with restrictions specified below) or cannot ("No") be used.

Usage Context

Global collections

Fields

ReportItems

Parameters

PageNumber

TotalPages

DataSource

DataSet

Variables

Scopes

PageHeader or PageFooter

Yes

Yes*

Yes

Yes

Yes

Yes

No

Body

Yes**

Yes***

Yes

No

Yes

Yes

Yes**********

ReportParameter

No

No

Yes****

No

No

No

No

Field

Yes

No

Yes

No

No<193>

No

No

Query Parameter

No

No

Yes

No

No

No

No

Group Expression

Yes

No

Yes

No

Yes

No

No

Sort Expression

Yes

No

Yes

No

Yes

Yes*****

No

Filter Expression

Yes

No

Yes

No

Yes

Yes*********

No

Code

No

No

Yes

No

No

No

No

Report.Language

No

No

Yes

No

No

No

No

Variables

Yes

No

Yes

No

Yes

Yes******

No

Aggregates

Yes

Yes*******

Yes

Yes********

Yes

No

No

Lookup

LookupSet

Yes

Yes

Yes

Yes

Yes

No

No***********

* MUST NOT contain more than one report item reference.

** If an expression in a non-detail section refers to a field that is not in the group expression for the group (or any ancestor grouping scope), which specific value is used is not defined. The expression SHOULD use the First() and Last() aggregate functions.

*** MUST NOT contain report item references other than those in the current or ancestor scope.

**** MUST NOT contain parameter references to subsequent parameters.

***** Variable references in sort expressions can appear in TablixMember, DataMember, and ChartMember elements. Variable references MUST NOT appear in DataRegion.SortExpressions.

****** MUST NOT contain variable references other than those in the current or ancestor scope.

******* MUST NOT be used outside a page header or page footer.

******** MUST NOT be used outside report item aggregates in a page header or page footer.

********* Variable references in filter expressions can appear in TablixMember, DataMember, and ChartMember elements. Variable references MUST NOT appear in DataRegion.Filters or DataSet.Filters.

********** MUST NOT be used for ReportItems outside DataRegion.

*********** can only be used in the Source expression of a Lookup function.

Note that, because references to items in global collections can be dynamic, such as in "=ReportItems(Parameters!Param1.Value)", all error checking occurs both during report validation (to catch static disallowed references) and during report execution (to catch dynamic disallowed references).

Cyclic expressions (such as TextBox1=TextBox2+1; TextBox2=TextBox1+1) are treated as non-critical errors.