Remove characters from left of string-SSRS 2008R2-Expression-Tablix Report



Scenario: I am looking to remove the characters value ‘SQL Server’ from the ‘SQL Server 9.00.4060.00’   in one column on the tablix report in SSRS report. How do we achieve that output?

Solution: Go to Business Intelligence (SSRS) ->File->New Project->Report server project.
Then Drag and Drop table control ->Drag and drop the required columns from the dataset (Set Query for fetching data) to show in the table report.
Next right click the data value of the specific column to change the expression as like below.


Then enter the expression values as like below.


=Right( Fields!products.Value, len(Fields!products.Value) - 10)


·         Fields!products.Value is the datavalue in the tablix column.
·         Right is used to remove the left side characters based on the second parameters value.
·         10 is the number of characters removed from the actual value.


Finally click ok.

Then preview the report as shown below. In the below tablix report output, SQL server is removed and only ‘2005 Service pack3 ‘is coming.

Output:






Comments

  1. Seems like there is a newer way to do this by appending

    .Remove(0,1)

    0 is the starting character, in this case the first character of the string, 1 is number of characters to remove.

    ReplyDelete

Post a Comment

Popular posts from this blog

SSIS2008R2 Error: 0xC0209303 at Package:

SQL2008R2 Error: The remote copy of database "XXXXX" has not been rolled forward to a point in time that is encompassed in the local copy of the database log. (Microsoft SQL Server, Error: 1412)