We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

use of parameter in custom code

Thread ID:

Created:

Updated:

Platform:

Replies:

130529 May 17,2017 07:45 AM UTC May 18,2017 12:52 PM UTC Report Platform 3
loading
Tags: Report Designer
Gregory Kohle
Asked On May 17, 2017 07:45 AM UTC

Hi,

how can we use an multi value text parameter in custom code?
I tried to use Parameters!Parametername in custom code and tried to
give the parameter to the custom code. Both resulted in errors.
Thanks.

Regards,
Patrick

Gregory Kohle
Replied On May 18, 2017 04:48 AM UTC

Hi,

here is my custom code function:
Public Function GetLabel(ByVal P as Parameter, ByVal lbl as String) as String
Dim i As Integer
For i = 0 to P.Ubound -1
If (P.Value = lbl) Then return P.Label
Next i
return lbl
End Function

And this is a call of this function:
= Code.GetLabel(Parameters!Labels, "MachineReport")

Regards,
Patrick

Gregory Kohle
Replied On May 18, 2017 05:22 AM UTC

Hi,

I got it working using the following code:
Public Function GetLabel(ByVal PValue as String, ByVal PLabel as String, ByVal lbl as String) as String
Dim i As Integer
Dim arrValues
arrValues = Split(PValue, ",")
Dim arrLabels
arrLabels = Split(PLabel, ",")
For i = 0 to Ubound(arrValues)
If (arrValues(i)= lbl) Then return arrLabels(i)
Next i
Return lbl
End Function

Is there some kind of other/better solution for this?
Thanks.

Regards,
Patrick

Vinoth Srinivasan [Syncfusion]
Replied On May 18, 2017 12:52 PM UTC

Hi Patrick, 
 
Thanks for using Syncfusion components. 
 
Currently, we don’t have support to use ReportParameter global collection directly in custom code. We have already logged feature request on this and it will be implemented in our upcoming releases. You can pass the joined value / label of a multi value parameter using Join expression (=Join(Parameters!MultiValueParam.Value,”,”) / =Join(Parameters!MultiValueParam.Label,”,”)) to the custom code method and process them inside code modules. 
 
Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;