I am using SQL Server Reporting Services 2008 to create a report. A table in this report displays hierarchical data, using a ID and ParentID field in the data. Each data row has an ID field and a ParentID field, where the ParentID points to the ID of the row that is its parent.
Displaying this hierarchically is no problem, but now I want to count the number of sub-items of a given row. For example:
row A (5) sub A (0) sub B (2) sub-sub A (0) sub-sub B (0) sub C (0)
I can calculate this count using the following expression:
=Count(Fields!IDField.Value, "RowDetails", Recursive) - 1
However, sometimes I want to hide certain rows, e.g. I want to hide sub-sub A
. How can I alter the above expression such that it will show a count of (1)
for sub B
in this case?