Click to Rate and Give Feedback

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
Other versions are also available for the following:
SQL Server 2008 Books Online (October 2009)
CountRows Function (Reporting Services)

Returns the number of rows in the specified scope, including rows with null values.

CountRows(scope, recursive)
scope

(String) The name of a dataset, data region, or group that contains the report items to count. For more information, see Using Built-in Report and Aggregate Functions in Expressions (Reporting Services) and Calculating Totals and Other Aggregates (Reporting Services).

recursive

(Enumerated Type) Optional. Simple (default) or RdlRecursive. Specifies whether to perform the aggregation recursively. For more information, see Creating Recursive Hierarchy Groups (Reporting Services).

Returns an Integer.

CountRows counts all rows in the specified scope, including rows that have null values.

The value of scope cannot be an expression and must refer to the current scope or a containing scope.

The following code example shows an expression that calculates the number of rows in a row group named GroupbyCategory (based on the expression [Category]).

="Number of rows: " & CountRows("GroupbyCategory")
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker