Display Parameter Value in SSRS Report

This SSRS article shows how to use the parameters and display the user-selected parameter value inside a report. To do this, we have to add a Text Box and write an expression that calls the Parameter value.

Right-Click on the Datasets folder to create a new DataSet. The screenshot below shows the data set we use for this Display Parameter Value in the SSRS Report example.

Employee Data Set

The Sql query that we used above SSRS example is:

SELECT Cat.[EnglishProductCategoryName] AS Category, 
       SubCat.[EnglishProductSubcategoryName] AS SubCategory, 
       Prod.EnglishProductName AS ProductName, 
       Prod.Color, 
       SUM(Fact.OrderQuantity) AS Orders, 
       SUM(Fact.TotalProductCost) AS ProductCost, 
       SUM(Fact.SalesAmount) AS Sales, 
       SUM(Fact.TaxAmt) AS Tax
FROM FactInternetSales AS Fact
   INNER JOIN DimProduct AS Prod ON Fact.ProductKey = Prod.ProductKey
   INNER JOIN DimProductSubcategory AS SubCat ON Prod.ProductSubcategoryKey = SubCat.ProductSubcategoryKey 
   INNER JOIN DimProductCategory AS Cat ON SubCat.ProductCategoryKey = Cat.ProductCategoryKey
GROUP BY Cat.[EnglishProductCategoryName], SubCat.[EnglishProductSubcategoryName],
		Prod.EnglishProductName, Prod.Color

We have created another data set of Category Names to use as the available parameter values.

DataSet for available values

How to Display Parameter Value in SSRS Report?

Right-click on the Parameters folder and choose Add Parameter option to open the following window. Add Category as name and prompt text.

Create a new parameter

Go to the available values tab and choose to get values from a query option. Next, select the CategoryNamesDSet data set we created earlier to get the distinct English Product Category names and choose the category as both the value and label field.

Choose the available values from DataSet

We have designed a simple sales and orders table report by product category and formatted the font and colors.

Simple Table to Display Parameter Value in SSRS Report

Double-click on the primary data set CatDSet, go to the filters tab, and click the add button to add a filter. Here, we have chosen the category column as an expression and clicked on the ƒx button beside the Value to write an expression. Next, please select the Category parameter by double-clicking it.

Add Filter expression at Dataset Level

Because of the filter, the report preview displays records whose product categories are equal to user-chosen @Category parameter values.

Set Filter value to Parameter

Right-click on the empty space, Select insert, and then the text box option. It will add a text box to the report.

Add a Text box to Display Parameter Value in SSRS Report

Right-click on the text box and choose the expression option from the context menu.

Choose the Expression option

Within the expression, we had chosen the Category or double-clicked on the parameter category to display its value in the text box.

Expression to Display Parameter Value in SSRS Report

Now you can see the category inside a text box. Besides writing an expression, you can also drag @category onto the text box, which will do the same.

Display Parameter Value in SSRS Report 11

In the SSRS report preview, you can see the selected Clothing (parameter value) displayed inside a report.

Display Parameter Value in SSRS Report Preview

Let me add a sample text to the text box. To write any text, you don’t have to edit the expression. Instead, perhaps type whatever you like within the text box, which will reflect the same.

Add random text to the textbox

The report review shows the random text we entered before and the category we chose.

Display Parameter Value with random custom text in SSRS Report