How To Use Grouping In SSRS

Introduction

SSRS grouping is mainly used to display different kinds of the same data, which are repeated in single reports. There are two type of creating grouping, which are shown below.

  1. Parent Grouping- It means just need to create a group with all rows outside the grouping.
  2. Child Grouping- It means just need to create a group with all rows inside the grouping.

Requirements

  • SQL Server 2016 (Microsoft SQL Server Enterprise Evaluation (64-bit).
  • Visual Studio - 2015 (Express Edition).
  • Microsoft Report Viewer control - Version 12.0.0.0.

Installation and Configuration

  • We need to install SQL Server 2016. The reporting Services should also be included.
  • We need to install Visual Studio 2015 Express Edition with SQL Server Business Intelligence Development Studio.

After installation process, the steps given below should be followed.

Step 1

Open Visual Studio and stat -> Add New project - > Right click solution -> click add, as shown below.


Step 2

Click Add-> New project -> Business Intelligence - > Reporting Service -> Report Server Project, as shown below.

 

Step 3

Right click Report -> Add New Report, as shown below.


Step 4

Click Next .


Step 5

Click Next ->Add connection string.


Step 6

Click Next -> click query builder.


Step 7

Select the Edit as text in the top corner and then there are two command type options here, followed by selecting the command type stored procedure, as shown below.


Step 8

Give the correct stored procedure name in the panel, as shown below.


Step 9

After giving the stored procedure name, click Next.


Step 10

Drag and drop the field from the available field to Display field and click Next.


Step 11

Click Next -> Finish.


Step 12

Finally add the DataSource and DataSet in the left hand side of the Window.


Step 13

Right click mouse button Select Insert -> Table - > Drag and drop the field from DataSet -> Select Data columns -> Right click on the above columns -> select Add group - > Parent Group.


Step 14

By default, select the Group By radio button and we need to select the dropdown list for the columns, which we are grouping. One more option is to click FX expression button and give the formula. Check the add group header, if you need to add the header in the group. Check the add group footer, if you need to add the footer in the group.

Click OK.


Step 15

Finally, the grouping will be set on the tablix.


Step 16

Click the Preview -> select The selected date -> view Report. The selected date is called passing the parameter in our stored procedure.


Step 17

Finally, we get the output as shown above.




Similar Articles