This is a migrated thread and some comments may be shown as answers.

User Function with ParamArray?

3 Answers 52 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aaron Abdis
Top achievements
Rank 1
Aaron Abdis asked on 05 May 2011, 05:33 PM
Can you use a user-function with a ParamArray as the argument? I tried but when i preview my report, it gives me the big dreaded error box and says The expression contains undefined function call CsvList().

Here is my function def:

Public Function CsvList(ParamArray items As String()) As String
    Return Join((From s In items Where Not String.IsNullOrEmpty(Trim(s)) Select s).ToArray, ", ")
End Function

and here is my call to the function:

= my_reports.General.CsvList(
  Fields.Firm,
  Fields.Name1,
  Fields.Name2,
  Fields.Address,
  Fields.AptType + " " + Fields.AptNum,
  Fields.City,
  Fields.State,
  Fields.Zip,
  "PH: " + Fields.Phone,
  "FX: " + Fields.Fax,
  "RSN: " + Fields.Reason
)

3 Answers, 1 is accepted

Sort by
0
Manfred
Top achievements
Rank 2
answered on 09 May 2011, 07:46 AM
Hi Aaron,

I only can talk for C# but there the functions have to be static to be used in Expressions.

Best Regards
Manfred
0
Aaron Abdis
Top achievements
Rank 1
answered on 09 May 2011, 03:43 PM
Thanks for the suggestion. That is a C# peculiarity I think (or a VB peculiarity, depending on your angle.  ;)  ). In VB you can put them in a module, as opposed to a class. I don't think C# has the concept of a module right? The closest I think is a static class. Several other functions in a module, with the same access/scope definition work fine.
0
Accepted
Peter
Telerik team
answered on 10 May 2011, 06:51 PM
Hi Aaron Abdis,

Currently User Functions do not support params/ParamArray keywords. However, your suggestion makes sense and we will have that in mind for subsequent versions of Telerik Reporting.

Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Aaron Abdis
Top achievements
Rank 1
Answers by
Manfred
Top achievements
Rank 2
Aaron Abdis
Top achievements
Rank 1
Peter
Telerik team
Share this question
or