Total Pageviews

Search This Blog

Monday, July 30, 2012

SQL Server CTEs and Recursive Parent Grouping in Advanced Mode Group Properties in SSRS


Few weeks ago, I was developing an interesting report in SSRS which pulls out data from AX - Projects module.

It was interesting for 2 reasons:

1. I learned to use more effectively SQL Server CTE's (Common table expressions) while developing this report.

From a layman's perspective, CTEs were introduced since SQL Server 2005 and it’s more useful to do a recursive search (display hierarchical data e.g. employee-manager, BOM etc). In my scenario, I had to do a recursive search for Project-Parent Id in my Stored proc)

Below sharing some links, which will explain further more in detail about CTE's and how to implement them.

2.  The second concept was about recursive parent Grouping (in SSRS)

In SSRS, we can group the child field based on the recursive parent key (There’s an option in the Edit Group > Advanced Section to key in the Recursive parent field) – explained here in this blog -

No comments: