SSRS Chr Function

The SSRS Chr and ChrW functions are Text functions that return the character associated with the given ASCII code or value. This article explains how to use the Chr and ChrW functions to find the character code in an integer column with an example.

The syntax of the SSRS Chr and ChrW functions to find the character associated with the ASCII code number is as shown below.

Chr(97)
ChrW(125)

To demonstrate the SSRS Chr and ChrW functions, we use the Employee table, which has 15 records grouped by Occupation. The image shows the records in the Table report.

Source Table

SSRS Chr function Example

As we don’t have any specific column to use for this example, we will extract the first two digits from the Income and Sales columns. Next, they will be used for the Chr function demonstration.

Let me add a new column to the right side of the Income column and name the header Chr Inc. Next, right-click the textbox under Chr Inc and choose Expression. To understand the report, I suggest you refer to the articles on charts, tables, grouping, and format tables in SSRS.

Choose the expression option

It opens the following expression window to find the ASCII value’s character. The left function below returns the first two digits from the YearlyIncome column. The SSRS Chr function returns the character belonging to that ASCII code.

=Chr(Left(Fields!YearlyIncome.Value, 2))
SSRS Chr Function expression to find the character associated to the ASCII code

Please click the preview tab to see the characters associated with the ASCII value (first two digits) from the Income column. 50 = 2, 80 = P, 70 = F, and 85 = U. For more functions >> Click Here!

SSRS Chr Function Preview

Let me create one more new column to the right of the Sales column and name it Chr Sl. Next, right-click the textbox under it to write the below expression. Here, the SSRS Chr function returns the character representing the ASCII code (first two digits) from the Sales column.

=Chr(Left(Fields!Sales.Value, 2))

If you check the report preview, 59 = ;, 49 = 1, 35 = #, and 69 = E.

SSRS Chr Function to find the character associated to the ASCII code preview