Microsoft Docs

Report Data Sets (SSRS)

A data set defines the data that a report uses. In SQL Server Reporting Services (SSRS), a data set consists of a query that retrieves data from a data source and the resulting fields that can be used in report items.

Creating a Data Set

  1. Open the Report Designer.
  2. Right‑click the Datasets node in the Report Data pane and select Add Dataset….
  3. Enter a name, choose a data source, and define the query.
  4. Click Refresh Fields to retrieve column metadata.
SELECT EmployeeID, FirstName, LastName, Title FROM HumanResources.Employee WHERE Title = @Title

Fields and Parameters

After creating a data set, the fields become available for drag‑and‑drop onto report items. Parameters can be added to the query to filter data at runtime.

FieldData TypeDescription
EmployeeIDIntUnique identifier for the employee.
FirstNameStringEmployee's first name.
LastNameStringEmployee's last name.
TitleStringJob title.

Applying Filters

Filters can be defined at the data set level to limit the rows returned without altering the underlying query.

{ "FilterExpression": "=Fields!Title.Value", "Operator": "Equals", "Value": "Sales Manager" }

Examples

Below is a complete example of a shared data set used across multiple reports.

-- SharedDataSet.rdl AdventureWorksDW SELECT EmployeeID, FirstName, LastName, Title FROM HumanResources.Employee EmployeeIDSystem.Int32 FirstNameSystem.String LastNameSystem.String TitleSystem.String