Disclaimer: I’m an SSRS n00b, so not too many rotten tomatoes please 🙂
I have a hierarchy of employees and managers which I had Reporting Services build using the Recursive Parent property. Here’s a crude representation:
-Jim Bob
Ray
-Steve
Ricky Bobby
Terry
For example, I need a count of the people under Steve, but when I call Count(Fields!EmployeeID.Value, "Details", Recursive) I get 3 instead of 2. Of course, I can just subtract 1 in the case of a count, but this won’t work when I need a sum. So the real question is how do I get a recursive aggregate that excludes the parent?
Additional info: I only have one group which is the default Details group. It’s set up just like this example, so I’m grouping by EmployeeID and I have the recursive parent set to ManagerID.
Update
A few workarounds I’ve tried to no avail:
- Adding a row inside the group – yields the same results because it’s still in the same scope as the other detail row.
- Adding a subtotal – doesn’t work because it’s outside the details group so it only renders once instead of once per manager.
Any ideas?
You could consider a couple of things.
1) you could provide counts in the SQL query that supplies the report, and then simply report it for each group using
2) You may be able to use your report’s code block to iteratively call a function, upping the count on a shared variable or doing some sort of arithmatic between parent sections and child sections to reflect the count when your report is presented. I know I have run into complications with this approach depending on SSRS version and to the level of complexity, nesting, subreports etc., in your report.