SSRS Str Function

The SSRS Str function is a Conversion function that will return the string representation of a given numeric field or number. The syntax of the Str function for returning the string representing a number is as shown below.

Str(Fields!Income.Value)

To demonstrate the Str function in reporting services, we use the Employee table below, which has 20 records. The image shows the records in the Table report.

Source Table

SSRS Str function Example

For this, let me add a new column to the right side of the Sales column. Next, right-click the textbox under the String Sales and choose the Expression to open the expression window shown below. The Str expression below will return the string representation of the SalesAmount column.

  1. More Functions
  2. Charts
  3. Tables
  4. Format tables
  5. SSRS
=Str(Fields!SalesAmount.Value)
SSRS Str Function expression to return the string representation of a given number

Similarly, let me create two more new columns to return the string representing numbers in the YearlyIncome and OrderQuantity columns. The SSRS Str function expressions to perform the same are shown below.

=Str(Fields!YearlyIncome.Value)

=Str(Fields!OrderQuantity.Value)

Please click the preview tab to see the Str report.

SSRS Str Function to return the string representation of a number report preview