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

Access to Multi Valued Parameters in Code Behind

3 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 23 Apr 2015, 05:32 PM

I'm trying to create a delimited string of values from the values selected via report multi-select parameter. How can I conduct a user function on a multi-select parameter, like the following:

Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender;
string ids = Join(",", rpt.Parameters["IDs"].Value)

This does not work in the ItemDataBinding event handler. 

Thanks.

3 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 23 Apr 2015, 05:45 PM

Got it to work. Here's what I did:

Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender;<br>var popstring = "";<br>var wbsstring = "";<br>object[] pops = (object[])rpt.Parameters["POPID"].Value;<br>object[] wbss = (object[])rpt.Parameters["WBS"].Value;<br><br>foreach (object pop in pops)<br>{<br>     popstring = popstring + pop.ToString() + ",";<br>}<br>popstring = popstring.Substring(0, popstring.Length - 1);<br>foreach (object wbs in wbss)<br>{<br>     wbsstring = wbsstring + wbs.ToString() + ",";<br>}

wbsstring = wbsstring.Substring(0, wbsstring.Length - 1);

 

0
Ben
Top achievements
Rank 1
answered on 23 Apr 2015, 05:49 PM

Here's the code again:

Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender;
var popstring = "";
var wbsstring = "";
object[] pops = (object[])rpt.Parameters["POPID"].Value;
object[] wbss = (object[])rpt.Parameters["WBS"].Value;
foreach (object pop in pops)
{
     popstring = popstring + pop.ToString() + ",";
}
popstring = popstring.Substring(0, popstring.Length - 1);
foreach (object wbs in wbss)
{
     wbsstring = wbsstring + wbs.ToString() + ",";
}
wbsstring = wbsstring.Substring(0, wbsstring.Length - 1);

0
Stef
Telerik team
answered on 27 Apr 2015, 02:57 PM
Hi Robert,

This is correct, you need to get the processing report and its Parameters collection in order to work with the selected parameter's value - Using Report Events.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Stef
Telerik team
Share this question
or