In this article, we will show you the step by step approach for creating SSRS Matrix Report using Report Wizard in SQL Server Reporting Services.
Creating SSRS Matrix Report using Report Wizard
When we right-click on the Reports folder, it provides various options to design reports.
- Add New Report: Open up the Report wizard to design report.
- Add: Gives us a choice to choose whether we want to design a report using Report Wizard or an empty report.
- Import Reports: We can import reports from the file system.
Here, we are selecting the first option, Add New Report. Once you click on this option, it will open the Report wizard. The first page is a Welcome screen, If you don’t want to see this page again, Please mark the Don’t show this page again option.
Select the Data Source: This page is used to configure the Data Source. Here we have two options:
- Shared data Source: If you already created the Shared data Source, Please select the data source name from the drop-down list.
- New data Source: If you haven’t already created the Data Source, Please select this option and create a New data source.
If you select the New Data Source, then the following properties will come into play. Please refer to the SSRS Shared Data Source article to understand the properties in detail.
This page is used to write the SQL Query to extract the data from the Data Source. If you are not familiar with SQL Queries, then click on the Query Builder button. Please refer SSRS Query Designer article to understand the steps involved in designing SQL Queries
In this example, we are coping the SQL Query from SQL Server Management Studio to Query String empty space
SQL Command we used in the above screenshot is:
SELECT FirstName, LastName, Gender, EmailAddress, YearlyIncome, EnglishEducation, EnglishOccupation, Phone FROM DimCustomer ORDER BY FirstName DESC, LastName DESC
Select the Report Type: Please select the Report type you wish to design.
- If you are designing the Table report, Please select the Tabular option.
- If you are designing a Matrix report, Please select the Matrix option.
Design the Matrix: Properties involved in this page are:
- Available Fields: List of columns we got it from the SQL Query we designed before
- Page: If you place anything, it will start a new page for every unique value
- Columns: If you want to perform any Column grouping operations, then place those columns in this place. Here, We are putting Gender in Column Grouping
- Rows: If you’re going to perform any Row grouping operations, then place those columns in this place. Here, We are placing English Occupation and English Education in Row Grouping
- Details: Columns added to this tab will show as output columns in the Table report. We are adding Sales Amount in this detailed tab
- Remove: This button will remove column names from Page, Grouping, and Details
NOTE: Please checkmark the Enable Drilldown option if you want to enable the Drill down operations otherwise, uncheck it
Choose the Table Style: You can select your own style as per your requirements. For now, we are selecting the Corporate style
Completing the Wizard: Please provide a valid name for the report and click on the finish button. Here, We assigned SSRS Matrix Report using Report Wizard name as report name
If you observe the above screenshot, You can see the SQL Query, Report Type, Data Source, and layout Type details.
Click the Finish button to finish creating the SSRS Matrix report using the report wizard.
From the above screenshot, you can observe the Final report with Row Groups and Column Groups.
TIP: If you want to add few more Row or Column Groups, you can add them in Row groups pane or Column Groups pane at the bottom
Click on the Preview button to see the report preview.
If you observe the above screenshot, It looks good. Still, there is no Header text for English Occupation and English Education columns. It may confuse the end-user so, Let’s add the header text.
Select the two Grouping cells, and right-click on it will open the Context Menu. Please select the Split Cells option and write the Header names in the Empty text boxes.
Click on the Preview button to see the report preview. Now, we can understand the Header Data
TIP: If you uncheck the Enable Drill down option in matrix wizard then, we have to apply manually.