SSRS LTrim Function

The SSRS LTrim function is a Text function that removes the leading spaces from the given field and returns a copy of the string. This article explains how to use the LTrim function to remove empty space from the left side of a string with an example.

The syntax of the SSRS LTrim function to create a new string by removing the leading spaces is as shown below.

=LTrim(Fields!Name.Value)

To demonstrate the LTrim function, we use the Employee table below, which has 15 records. The image shows the records in the Table report. Notice the empty spaces on the left and right sides of the content in the Full Name and Email columns.

Source Table

SSRS LTrim function Example

For this, let me add a new column to the right side of the Full Name column. Next, right-click the textbox under the LTrim 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.

It opens the following expression window to remove leading spaces. The below SSRS LTrim function deletes the empty spaces from the left side of the Full Name column and returns a new string.

=LTrim(Fields!FullName.Value)
SSRS LTrim Function expression to remove leading empty spaces

Similarly, let me create one more column to the right of the email column. Next, right-click the textbox under LTrim Mail to write the expression below. Here, the LTrim function removes leading spaces from the Email column. For more functions, Click Here!

=LTrim(Fields!Email.Value)

Please click the preview tab to see the result. Although the SSRS LTrim function removed the empty spaces on the left side, you can still see the spaces on the right side. To remove them, use the RTrim or Trim function.

SSRS LTrim Function to remove leading (left side) empty spaces preview