Javascript report action

3 posts, 0 answers
  1. Clinton Smyth
    Clinton Smyth avatar
    65 posts
    Member since:
    Apr 2007

    Posted 02 Mar Link to this post

    Hi

    We're adding interactive functionality to our reports and would like to run a javascript function when an item is clicked on. Is this possible?

    We've been reviewing report actions and can add a URL link (http://docs.telerik.com/reporting/designing-reports-interactivity-how-to-add-hyperlink) but a much improved user experience can be implemented with a javascript function.

    Is there a way to do this?

    Thanks

  2. Clinton Smyth
    Clinton Smyth avatar
    65 posts
    Member since:
    Apr 2007

    Posted 02 Mar in reply to Clinton Smyth Link to this post

    Just figured it out!

    Create a 'Navigate to URL' action and add the following URL:

    = Format("javascript:openDetailsWindow(""{0}"")", Fields.CostCode)

    The trick was escaping the parameter quotes properly!

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

    Posted 07 Mar Link to this post

    Hi Clinton,

    The applied solution is a hack that we do not recommend. The HTML rendering is updated and actions are not rendered as anchor tags, but as 'data-reporting-action' attributes which are handled by the viewer. Still our development team will investigate further the scenario due to security concerns.

    Please elaborate on the functionality you need on navigating to an external URL. Note that the target page can include the desired scripts that will be executed on loading the page.


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