How to add Code to an SSRS Report ?

Add SSRS Code

•Add an Assembly Reference to a Report (SSRS). see Custom Code and Assembly References in Expressions in Report Designer (SSRS).

•Provide a custom code assembly by using the .NET Framework.
To add embedded code to a report

1.In Design view, right-click the design surface outside the border of the report and click Report Properties.

2.Click Code.

3.In Custom code, type the code.

Public Function ChangeWord(ByVal s As String) As String
Dim strBuilder As New System.Text.StringBuilder(s)
If s.Contains(“Raj”) Then
strBuilder.Replace(“Raj”, “Raja”)
Return strBuilder.ToString()
Else : Return s
End If
End Function

If you add this expression to a table cell that displays category values, whenever the word “Raj” is in the dataset field for that row the table cell value displays the word “Raja” instead.

How to add Code to an SSRS Report ? was last modified: October 1st, 2017 by Justin Antony

About Justin Antony

Leave a Reply