I am developing an RDL in SSRS 2008 R2. I have a working parent report which currently links to a subreport. These reports connect via a PK/FK. For example:
create table #sample_data ( parent_key uniqueidentifier, child_key uniqueidentifier, col_filter varchar(30), row_details int ) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88300','ADE42E8E-A995-4FAE-9891-00B1DAD88439','parent layer',1) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88300','ADE42E8E-A995-4FAE-9891-00B1DAD88410','parent layer',8) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88439','ADE42E8E-A995-4FAE-9891-00B1DAD88450','child layer',2) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88439','ADE42E8E-A995-4FAE-9891-00B1DAD88451','child layer',6) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88439','ADE42E8E-A995-4FAE-9891-00B1DAD88452','child layer',7) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88410','ADE42E8E-A995-4FAE-9891-00B1DAD88453','child layer',9) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88410','ADE42E8E-A995-4FAE-9891-00B1DAD88454','child layer',10) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88450','ADE42E8E-A995-4FAE-9891-00B1DAD88455','lowest layer',3) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88450','ADE42E8E-A995-4FAE-9891-00B1DAD88456','lowest layer',4) insert #sample_data values('ADE42E8E-A995-4FAE-9891-00B1DAD88450','ADE42E8E-A995-4FAE-9891-00B1DAD88457','lowest layer',5) select * from #sample_data order by row_details
Now I want to display each matching child layer below its corresponding parent layer according to the ordering of row_details. How can I achieve this?
The tricky parts: 1. This table uses a UNIQUEIDENTIFIER field to connect the parent-child relationship 2. parent row lines up with child row via parent_key to child_key, but on different rows
3. The parent and child data pull from the same dataset, but filter on a different field value. 4. The parent__key field is used as both a parent_key and child_key 5. The ordering has to follow order of row_details. This means that the output data is interlacing.
It is not all of parent rows followed by child rows. Instead it is just one parent row followed by its child rows and then the next parent row followed by its child rows.
So although parent_layer.child_key = child_layer.parent_key, also child_layer.child_key = lowest_layer.parent_key.
I have tried using a list, seperate tablices, and separate groups, but I can't get this to work correctly. Currently I am using subreports, but because there are 5 nested levels of subreports, I am trying to speed this report up by just using one report.
Also, I have tried this solution, but this does not work in my case: http://sqldusty.wordpress.com/2011/07/23/creating-stepped-reports-with-ssrs-2008/
Ryan D