SSRS Len Function

The SSRS Len function is a Text function that returns the total number of characters in a string field or the total bytes needed to store a variable. This article explains how to use the Len function to return an integer containing the length of a string with an example.

The syntax of the SSRS Len function to find the total number of characters or length of a string is as shown below.

=Len(Fields!FullName.Value)

To demonstrate the SSRS Len function, we use the Employee table below, which has 15 records. The image shows the records in the Table report.

Source Table

SSRS Len function Example

For this, let me add a new column to the right side of the Name column. Next, right-click the textbox under the LN Name and choose the 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 return the string length. The SSRS Len function below returns the total number of characters in the Name column and an integer value.

=Len(Fields!Name.Value)
SSRS Len Function expression to find the total number of characters in a string

Please click the preview tab to see the report. Remember, it counts the empty space as a single character. For more functions >> Click Here!

SSRS Len Function preview

Similarly, let me create two more new columns to the right of the Education and Email_Address columns. Next, right-click the textbox under them to write the below expressions. Here, the Len function returns the string’s length or total number of characters inside the Education and Email columns.

=Len(Fields!Education.Value)
=Len(Fields!Email_Adress.Value)

Please check the report preview.

SSRS Len Function to find the string length preview