SSRS InScope() function: The key to format your matrix!

The InScope() function checks to see if the current item is in the specified scope.
For a basic matrix report with the use of ‘Totals’ on both axes:

The Green cells fall out-of-scope of the ColumnGroup, and In-Scope for the RowGroup
The Grey cells fall out-of-scope of the RowGroup, and In-Scope for the ColumnGroup
The Light blue cells fall In-Scope of both the ColumnGroup and the RowGroup.
The Dark blue cell falls out-of-scope of both the ColumnGroup and the RowGroup.

Expression example code:

=IIf(InScope(“ColumnGroup”),
IIf(InScope(“RowGroup”),”LightBlue”, ”Grey”),
IIf(InScope(“RowGroup”),”DarkGreen”, “DarkBlue”)
)

Thanks to Luke Hayler for his great example.





About these ads

One thought on “SSRS InScope() function: The key to format your matrix!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s