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. Image for the cookie policy date
If you became a customer of the Syncfusion Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion for your reporting needs.

use of parameter in custom code

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

3 Replies

GK Gregory Kohle 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


GK Gregory Kohle 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


VS Vinoth Srinivasan Syncfusion Team 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. 


Loader.
Up arrow icon