How to access report name and report parameters via JavaScript/Jquery in the report viewer.

3 posts, 0 answers
  1. Jim
    Jim avatar
    25 posts
    Member since:
    Mar 2016

    Posted 23 Aug Link to this post

    All of my reports shown in the report viewer in my MVC site.

    However there is a need to add my own event to the viewer. (i.e. I will add a new button to the view).

    My question is how can I get the report name and report parameters via javascript?  I will need this information to pass back to my controller to do my own "custom" action.

  2. Jim
    Jim avatar
    25 posts
    Member since:
    Mar 2016

    Posted 23 Aug Link to this post

    As a work around I added a string and ParameterCollection to my ViewModel and loaded the information that way.

    However is it possible to serialize/deserialize the ParameterCollection?

    I'm getting the error:

    Could not cast or convert from System.String to Telerik.Reporting.ParameterCollection. when I try to deserialize the string.

    I've tried:

    1. Serializing the ParameterCollection in the controller (i.e. Defined as a string in ViewModel), passing it as a string and deserializing it in another controller.

    2. Passing the ParameterCollection to the ViewModel (i.e. Defined as ParameterCollection in ViewModel), serializing it in JS and deserializing it in the controller.

  3. DevCraft banner
  4. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 23 Aug Link to this post

    Hi Jim,

    Below is a quote from my response in your support ticket on the same question:
    "If the displayed report has visible parameters, the viewer will display its parameters area. Once the user select values for all parameters, the Preview button must be clicked in order the values to be submitted to the server. The last submitted values can be retrieved from the viewer's reportSource (report string and parameters Json stringified collection) - reportSource(rs)."


    I hope this helps.

    Regards,
    Stef
    Telerik by Progress
    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