Data Layout - Do you have nodes count like Outlook?

Updated by Brady Stroud [SSW] 5 months ago. See history

123

A report with drill through like this should have the number in nodes like Outlook.

Image

❌ Figure: Bad example - This does not have the nodes count

Image

✅ Figure: Good example - This does have the nodes count

Here's how to add nodes count to the textbox with "collapsed(+)" in your report:

In the Expression property of the Textbox, add an expression to show nodes count. Use the following expression:

--Change the SQL ( or add a new DataSet )
SELECT a.TerritoryID, ( CONVERT ( varchar,a.TerritoryDescription ) + ' (' + CONVERT ( varchar, count ( c.TerritoryID ) ) + ')' ) AS Number, ... FROM Territories a INNER JOIN EmployeeTerritories b ON a.TerritoryID=b.TerritoryID, ... GROUP BY a.TerritoryID, a.TerritoryDescription,...
--Expression to show nodes count
= Fields!Number.Value

❌ Figure: Bad example - Get the Outlook Node Count look by changing the SQL.

--Expression to show nodes count
= Fields!Name.Value + "(" + CStr ( CountRows( ) ) + ")"

✅ Figure: Use the CountRows() function to get the Outlook Node Count look

Note: The CountRows function is one of the several native functions provided by Reporting Services and returns the count of rows within a specified scope. If no scope is specified, it defaults to the innermost scope, which in our case resolves to the static group that defines the values in the data cells.

acknowledgements
related rules