This is a migrated thread and some comments may be shown as answers.

Javascript report action

2 Answers 146 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Clinton Smyth
Top achievements
Rank 1
Clinton Smyth asked on 02 Mar 2016, 09:34 PM

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 Answers, 1 is accepted

Sort by
0
Clinton Smyth
Top achievements
Rank 1
answered on 02 Mar 2016, 09:49 PM

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!

0
Stef
Telerik team
answered on 07 Mar 2016, 05:38 PM
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
Tags
Report Designer (standalone)
Asked by
Clinton Smyth
Top achievements
Rank 1
Answers by
Clinton Smyth
Top achievements
Rank 1
Stef
Telerik team
Share this question
or