I am using Telerik Reporting Q3 2009 and I have a user function defined.
When I use it inside my code it works fine but when I call it from the report it does not return the expected value.
Here is the code in VB.Net:
GetResourceValue("Txt:Days", "CoreFunctions")
which returns : Days
Inside the report in a table field I use the following expression:
=TelerikReports.modCommon.GetResourceValue("Txt:Days", "CoreFunctions")
which returns" Txt:Days"
Here is my function:
Public Function GetResourceValue(ByVal sKey As String, ByVal sAppName As String) As String
Try
Dim ds As New DataSet
ds.ReadXml(System.Web.HttpContext.Current.Server.MapPath(".") & "\..\ResourceFiles\" & sAppName & "." & LANGUAGE & ".resx")
Dim rows() As DataRow = ds.Tables("data").Select("name = '" & sKey & "'")
If rows.Length > 0 Then
Return rows(0)("value")
Else
Return sKey
End If
Catch ex As Exception
Return sKey
End Try
End Function
Any idea ?
Thanks in advance