SSRS CStr Function

The SSRS CStr is a Conversion function that converts the given field or expression to a string. The syntax of the CStr function for converting to string type is as shown below.

CStr(Fields!Income.Value)
CStr(Fields!HireDate.Value)

To demonstrate the CStr 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 CStr function Example

For this, let me add a new column to the right side of the BirthDate column. Next, right-click the textbox under the CStr and choose the Expression to open the expression window shown below. The CStr expression below will convert the BirthDate column values to string type.

  1. More Functions
  2. Charts
  3. Tables
  4. Format tables
  5. SSRS
=CStr(Fields!BirthDate.Value)
SSRS CStr Function expression to convert the  column to String

Similarly, let me create one more new column to convert the YearlyIncome values to a string datatype. The SSRS CStr function expression to perform the same is shown below.

=CStr(Fields!YearlyIncome.Value)

Please click the preview tab to see the CStr report.

SSRS CStr Function to convert the expression to String report