问题
I've got a SSRS report that builds a recursive hierarchy using the Recursive Parent property. I need to sort by a field in the dataset (not interactive sorting, just plain sorting). I've set it on the Details group but Reporting Services won't do the sort.
If I remove the recursive grouping and return it to a flat dataset, the sort works as expected, so I know it is because of the hierarchy. Anyone else ever run into this?
回答1:
Sorting within a recursive hierarchy will only affect the order of items at the same level, within the same node.
So, for example, if Peter is the manager of Fred and Sid, then sorting ascending on name will produce the output:
Peter
Fred
Sid
While sorting descending on name will produce the output:
Peter
Sid
Fred
Under these circumstances, Peter can never appear between Fred and Sid because he is at a higher level within the hierarchy.
来源:https://stackoverflow.com/questions/9284396/ssrs-ignores-sort-in-a-recursive-hierarchy