Indicates whether the current instance of an item is in the specified scope.
InScope(scope)
(String) The name of a dataset, data region, or group that specifies a scope. For more information about the scope parameter, see Using Built-in Report and Aggregate Functions in Expressions (Reporting Services) and Calculating Totals and Other Aggregates (Reporting Services).
Returns a Boolean.
The InScope function tests the scope of the current instance of a report item for membership in the scope specified by the scope parameter.
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:
ProductDetail
Month
ProductSummary
=Iif(InScope("Month"), "ProductDetail", "ProductSummary")
Product
=Not(InScope("Product"))
The following code example indicates whether the current instance of the item is in the Product dataset, data region, or group scope.
=InScope("Product")