When are ReportParameters Values available when they are passed in?

2 posts, 0 answers
  1. Edward
    Edward avatar
    65 posts
    Member since:
    Oct 2018

    Posted 22 Oct 2018 Link to this post

    Have a class deriving from Telerik.Reporting.Report.  The report has parameters which have values being passed in.  They are being passed in because I can print out their values on the report.

    But I would like to intercept their values at some point in the code to do something with them, but when referencing them they are all null.

    Tried referencing them in the constructor of the report, as this.ReportParameters.

    Tried adding event handlers to various events of the report object, as well as events of datasource objects within the report.  What event handler needs to be handled where the ReportParameters will be available when they are passed in from outside?

    Passing in parameter values from HTML5 viewer using reportSource property as object value set to parameters.

  2. Ivan Hristov
    Ivan Hristov avatar
    220 posts

    Posted 25 Oct 2018 Link to this post

    Hi Edward,

    The report parameters from the viewer are being transferred to Telerik.Reporting.Processing.Parameter instances when the report processing is started, so each event that provides Telerik.Reporting.Processing.Report instance should suffice. For example, the following code snippet will output the parameter names and their values as they are set in the report viewer (not the default ones set in the Dashboard report definitions), which should be applicable to the current scenario:
    public Dashboard()
        /// <summary>
        /// Required for Telerik Reporting designer support
        /// </summary>
        this.ItemDataBound += (s, e) =>
            foreach (var p in ((Processing.Report)s).Parameters)
                System.Diagnostics.Debug.WriteLine("{0} {1}", p.Key, ((Processing.Parameter)p.Value).Value);

    Hope this helps.

    Ivan Hristov
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top