How to Use Variable Functions in EventCode
Posted: Fri Jan 18, 2008 2:47 am
Hi,
i tried to use a dictionary variable function in the Report.BeginRender event to dynamically create a display string for my report. With normal variable all is working as expected, but with function variables i'getting the expression code an not the value. How do i get the correct value an not the expression?
For example the i attached my code. The variables were:
PersonResponsible
ManagedDisplay
Parameters2Show
ParameterNames2Show
The Result for ParametersDisplayLine is something like:
The Code in the Report.BeginRender event is:
i tried to use a dictionary variable function in the Report.BeginRender event to dynamically create a display string for my report. With normal variable all is working as expected, but with function variables i'getting the expression code an not the value. How do i get the correct value an not the expression?
For example the i attached my code. The variables were:
PersonResponsible
Code: Select all
Test
Code: Select all
IIF(Managed="1","Managed",IIF(Managed="0","Unmanaged","All"))
Code: Select all
PersonResponsible;ManagedDisplay
Code: Select all
Resource Owner;Management State
Code: Select all
Resource Owner=Test, Management State=IIF(Managed="1","Managed",IIF(Managed="0","Unmanaged","All"))
Code: Select all
Dim strParameters() as String = Parameters2Show.Split(";"c)
Dim strParameterNames() as String = ParameterNames2Show.Split(";"c)
Dim i as Integer
ParametersDisplay = ""
ParametersDisplayLine = ""
For i = 0 To strParameters.GetUpperBound(0)
If Me.Dictionary.Variables(strParameters(i)).Value.Length > 0 Then
If ParametersDisplay.Length > 0 Then
ParametersDisplay = ParametersDisplay & vbCrLf & strParameterNames(i) & vbTab & "= " & Me.Dictionary.Variables(strParameters(i)).Value
ParametersDisplayLine = ParametersDisplayLine & ", " & strParameterNames(i) & "=" & Me.Dictionary.Variables(strParameters(i)).Value
Else
ParametersDisplay = strParameterNames(i) & vbTab & "= " & Me.Dictionary.Variables(strParameters(i)).Value
ParametersDisplayLine = strParameterNames(i) & "=" & Me.Dictionary.Variables(strParameters(i)).Value
End If
End If
Next