Report Builder Functions - InScope Function

Indicates whether the current instance of an item is in the specified scope.

Note

You can create and modify paginated report definition (.rdl) files in Report Builder and in Report Designer in SQL Server Data Tools. Each authoring environment provides different ways to create, open, and save reports and related items.

Syntax

InScope(scope)  

Parameters

scope
(String) The name of a dataset, data region, or group that specifies a scope.

Return Type

Returns a Boolean.

Remarks

The InScope function tests the scope of the current instance of a report item for membership in the scope specified by the scopeparameter.

Scope cannot be an expression.

A typical use for the InScope function is in data regions that have dynamic scoping. For example, InScope can be used in a drillthrough link in a data region cells to provide a different report name and different sets of parameters depending on which cell is clicked. An example of this is as follows:

Example

The following code example indicates whether the current instance of the item is in the Product dataset, data region, or group scope.

=InScope("Product")  

See Also

Expression Uses in Reports (Report Builder and SSRS)
Expression Examples (Report Builder and SSRS)
Data Types in Expressions (Report Builder and SSRS)
Expression Scope for Totals, Aggregates, and Built-in Collections (Report Builder and SSRS)