Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 3.39 KB

File metadata and controls

66 lines (47 loc) · 3.39 KB
title InScope function in a paginated report
description The InScope function in a paginated report indicates whether the current instance of an item is in the specified scope in Report Builder.
ms.date 09/25/2024
ms.service reporting-services
ms.subservice report-design
ms.topic how-to
ms.custom
updatefrequency5

Report Builder functions - InScope function in a paginated report (Report Builder)

[!INCLUDEssrs-appliesto] [!INCLUDE ssrs-appliesto-ssrs-rb] [!INCLUDE ssrs-appliesto-pbi-rb] [!INCLUDE ssrb-applies-to-ssdt-yes]

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

Note

[!INCLUDEssRBRDDup]

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 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:

  • The following expression, used as the report name in a drillthrough link, opens the ProductDetail report if the clicked cell is in the Month group, and the ProductSummary report if it is not.

    =Iif(InScope("Month"), "ProductDetail", "ProductSummary")  
    
  • The following 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 group.

    =Not(InScope("Product"))  
    

For more information, see Aggregate Functions Reference (Report Builder and SSRS) and Expression Scope for Totals, Aggregates, and Built-in Collections (Report Builder and SSRS).

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")  

Related content