SSRS Report Wizard Query Builder

This SSRS article shows how to use the Query Builder in the report wizard to generate a T-SQL query with an example. For this query builder demo, we create a data source pointing to Adventure Works DW 2019. 

SSRS Report Wizard Query Builder

In the Solution Explorer, right-click on the Reports folder and select Add New Report option from the context menu.

Add New Report Option

It opens the report wizard welcome page. Click the next button to continue.

welcome page

If you have an existing Data Source, select the shared data source. Here, we create a new pointing Adventure Works DW Database with SQL Server authentication.

Shared Data Source

The next page is to design the Sql query to use in SSRS. To use the existing query string, paste it inside the space provided. However, in this example, we want to use the query builder to design, so click on it.

SSRS Query Builder or Designer in Report Wizard

It opens the SSRS Query Designer or Builder window inside a report wizard. Right-click on the empty space and choose the Add Table.. option to add database tables.

SSRS Query Builder or Designer to add tables in Report Wizard

We have chosen the DimCustomer and FactInternetSales tables.

SSRS Query Builder or Designer to select multiple tables in Report Wizard

Checkmark the columns you need to design a report.

  • Alias – Assign a New name to the Column.
  • Sort Type – Order by Clause.
  • Sort Order – Which one is the first one to apply to sort?
  • Use the! button to see the result.

The code below selects the employee sales order by first name in ascending order and last name in Ascending.

SSRS Query Builder or Designer to select columns in Report Wizard

Filter – To apply where condition in SSRS Report Wizard Query Builder.

Here, we used the Filter on Sales column to return the employees whose sales amount is greater than 1000. Once you are Ok with the result, click Ok to close the Query designer window.

SSRS Query Builder or Designer to use Where Clause in Report Wizard

Click the Next button.

Final Query of SSRS Query Builder or Designer in Report Wizard

Select Tabular as the report type and click Next.

Tabular Report Type

Design the table with the available fields. Let me add all the columns to the Details section to create a table. Next, change the default report name and click the Finish button.

Add Fields to table Details

Now you can see the auto-generated table using the SSRS report wizard query builder.

Auto-genearted Table Report from SSRS Query Builder or Designer in Wizard

Let us see the report preview.

SSRS Query Builder or Designer in Report Wizard