Access to Multi Valued Parameters in Code Behind

4 posts, 0 answers
  1. Ben
    Ben avatar
    7 posts
    Member since:
    Feb 2015

    Posted 23 Apr 2015 Link to this post

    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.

  2. Ben
    Ben avatar
    7 posts
    Member since:
    Feb 2015

    Posted 23 Apr 2015 in reply to Ben Link to this post

    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);

     

  3. Ben
    Ben avatar
    7 posts
    Member since:
    Feb 2015

    Posted 23 Apr 2015 in reply to Ben Link to this post

    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);

  4. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 27 Apr 2015 Link to this post

    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.

     
Back to Top