unable to call custom code in ssrs 2008 r2
i have placed the following code in code section Public Function ChangeWord(ByVal s As String) As String Dim strBuilder As New System.Text.StringBuilder(s) If s.Contains("com") Then strBuilder.Replace("com", "in") Return strBuilder.ToString() Else : Return s End If End Function i have column called empmail which contains employee mail ids. In data field of empmail column i have added the expression =Code.ChangeWord(Fields!empmail.Value)its saying ChangeWord is an unrecognized keyword thank you
November 9th, 2012 6:23am

Hi, I have removed : after else . Check if it works. Public Function ChangeWord(ByVal s As String) As String Dim strBuilder As New System.Text.StringBuilder(s) If s.Contains("com") Then strBuilder.Replace("com", "in") Return strBuilder.ToString() Else Return s End If End Function Regards, Akhila VasishtaThanks in advance, Akhila Vasishta
Free Windows Admin Tool Kit Click here and download it now
November 9th, 2012 6:46am

ya i removed (:) , but still in the expression =Code.ChangeWord(Fields!empmail.Value) function name ChangeWord display "Unrecognized Identifier". Any assemblies do i need to put or some settings needs to be done for custom coding? thank you
November 12th, 2012 12:06am

Hello, I try to reproduce the issue in my test environment with the same custom code. However, it returns the exact result. Please try to use the following expression. =code.ChangeWord(CStr(Fields!empmail.value)). When the above expression doesn't work, you can try to recreate the report with same code, since the issue might be caused by data cache. If the issue persists, could you please post both the report and the dataset with sample data to us by the following E-mail address? It is benefit for us to do further analysis. E-mail: sqltnsp@microsoft.com Regards, Fanny LiuFanny Liu TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2012 1:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics