Getting the current report parameter values on the client

2 posts, 0 answers
  1. Ian
    Ian avatar
    18 posts
    Member since:
    Nov 2013

    Posted 21 Sep 2018 Link to this post

    Hi 

    I'm using HTML5 report viewer.

    According to the following post I should be able to retrieve the current report parameters using this code:

    var viewer = $("#reportViewer1").data("telerik_ReportViewer");
     var currentParams = viewer.reportSource().parameters;

     

    This method seems to return the last submitted values parameters only and not the 'current' values. For example the default start and end date parameter values in my report depend on another report-type parameter. This works well displaying the required default values in the parameter window. However the code above doesn't return these current values unless the values are actually submitted with "Preview".

    Can you suggest a work around to retrieve the current displayed values of each parameter even before they are submitted to Telerik reporting. I already have custom editors and I could attach my own code to monitor the current values - but is there a better recommended way? 

    Thanks in advance.

    Ian

  2. Todor
    Admin
    Todor avatar
    518 posts

    Posted 26 Sep 2018 Link to this post

    Hello Ian,

    This is a summary of my response to the support ticket you opened on the same topic:

    The default parameter values will be assigned to the reportSource().parameters collection upon initial opening of the Html5 Report Viewer - provided there are no explicit values assigned in the configuration of the viewer. This is valid when using the default or custom parameter editors.

    When the parameter values get changed by the user in the Viewer Parameter's area, it is necessary to preview in order the new values to be assigned to the reportSource().parameters collection. Until then the previous values will be hold in the collection.

    When all Report Parameters have their property 'AutoRefresh' set to True in the report definition, upon each parameter value update the report will be automatically refreshed, hence reportSource().parameters collection will have the updated value(s).

    If there are cascading parameters with 'AutoRefresh' set to False, upon updating the filtering parameter the cascading parameter AvailableValues collection will be updated. The reportSource().parameters collection will *not* be updated automatically - it will still be necessary to click "Preview".

    The reportSource can be updated by assigning its properties new values using reportSource(rs).

    You may invoke onclick event of the "Preview" button also with custom code - it is a button element with class 'trv-parameters-area-preview-button'.

    The Html5 viewer exposes commands - refresh among them. It will be necessary to modify the viewer reportSource(rs) with the new parameter values before invoking it for the changes to have effect.

    Regards,
    Todor
    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