0
votes

I am trying to figure out how to create indented child rows under the parent, in SSRS report. I am quite new to SSRS, the group by function works in a different (and obvious) way then what I want.

I have a sample dataset as below.

Declare @Employee Table(Code varchar(10), Name varchar(500), 
Organization varchar(100), IsChild bit, ParentId varchar(10))

insert into @Employee Values('BR456','Brandon','XYZ',0,NULL)
insert into @Employee Values('CR674','Carolina','ABC',0,NULL)
insert into @Employee Values('ME230','Melissa','PQR',1,'CR674')
insert into @Employee Values('JR987','Jerome','LMN',0,NULL)
insert into @Employee Values('JO435','Joseph','IJK',0,NULL)
insert into @Employee Values('ME321','Meghan','UVW',1,'JO435')

Here, Melissa is child of Carolina & Meghan is child to Joseph. I am looking for below result. I could not find example matching this.

Is it possible to make this using some formatting options?

Code       Name       Organization
BR456      Brandon    XYZ
CR674      Carolina   ABC
  ME230    Melissa    PQR
JR987      Jerome     LMN
2

2 Answers

1
votes

you can use the padding options: right click on the cell you want to indent, [Code] in this case, then select Text Box Properties -> Alignment then, under Padding options, click the Expression button (Fx) and replace whatever is there (probably "2pt") with this expression:

=IIf(Fields!IsChild.Value="False","2pt","8pt")
0
votes

Received answer from another forum. Posting here for useful reference.

Answer by Qiuyun Yu

In Reporting Services, a recursive hierarchy group organizes data from a single report dataset that includes multiple hierarchical levels, such as the report-to structure for manager-employee relationships in an organizational hierarchy. In your scenario, the dataset contains all the hierarchical data, so you can create a recursive hierarchy group. Then format a recursive hierarchy group with indent levels.

Reference: Create a recursive hierarchy group Using recursive hierarchy group in SSRS 2012