InScope Function (Visual Studio Report Designer)
Indicates whether the current instance of an item is within the specified scope.
InScope(Scope)
Parameters
- Scope
(String) The name of a data table, object, grouping, or data region that contains the report items to which to apply the function.
Return Type
Returns a Boolean.
Remarks
The InScope function is useful in data regions that have dynamic scoping, such as a matrix. For example, InScope can be used in a drillthrough link in a matrix cell to provide a different report name and different sets of parameters depending on which cell is clicked. An example of this is as follows:
This expression, used as the report name in a drillthrough link, opens the ProductDetail report if the clicked cell is in the Month grouping, and the ProductSummary report if it is not.
=Iif(InScope("Month"), "ProductDetail", "ProductSummary")
This expression, used in the Omit property of a drillthrough report parameter, will pass the parameter to the target report only if the clicked cell is in the Product grouping.
=Not(InScope("Product"))
Example
The following code example indicates whether the current instance of the item is within the Product dataset, data region, or grouping.
InScope("Product")
See Also
Concepts
Using Expressions in a Report (Visual Studio Report Designer)
Adding Custom Code to a Report (Visual Studio Report Designer)
ReportViewer Controls (Visual Studio)
Built-in Functions for Reports (Visual Studio Report Designer)