Thursday, March 21, 2013

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:






1 comment:

  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

MYSQL:::Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables

  Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables Introduction: In the dynamic landscape of database management...