My report has a multi select parameter filled with regions which I want to display as a comma separated list in a textbox.
I would think that this is a commonly required feature so you can display what the report is currently filtering on.
If I use the parameter value or text in the textbox it displays System.Text[]
5 Answers, 1 is accepted
The multi-value report parameter returns an array for value. Generally arrays can be represented in different ways. Thus our suggestion is to utilize user functions. For your scenario you can use the following user function and expression:
public
static
string
ConvertArrayToString(
object
[] values)
{
var result =
new
StringBuilder(values[0].ToString(),values.Length);
for
(
int
i = 1; i < values.Length; i++ )
{
result.AppendFormat(
", {0}"
, values[i]);
}
return
result.ToString();
}
Peter
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I would really like to use this function but I am not sure where to put the code that creates the function. Could you please tell where the function in created in the project. I am using VS 2012, thanks
As elaborated in the user functions help article, you can add user functions in the report's code behind. Select the target report and press F7 to open the reports code behind. After adding the necessary user functions, in order to list them in expression editor you have to build the project.
Regards,Peter
the Telerik team
HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!
Thanks for your reply, I have tried to add this to the code and rebuild my project but I get errors. I attach a screenshot of where i am putting the code. I am not a programmer so forgive me if my query is a little basic.
Many thanks
Gerry