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

Client Side support

3 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 24 Mar 2017, 07:42 AM

Can we pass html elements such as <button onclick = "dosomething()"> </button> to  htmltextbox in html5 report viewer

 

3 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 24 Mar 2017, 02:34 PM
Hi Mark,

HtmlTextBox item is designed to be used for displaying the data in the report but not for adding custom HTML elements to the page with the viewer. Thus, <button> tag is not supported.

You can apply an Interactive Action to the report item and add a custom function in interactiveActionExecuting event handler which will be triggered when you click on this item in HTML5 Report Viewer.
If you interested in this approach, more details are provided in How to add interactivity to a report using action event handlers in HTML5-based report viewers KB article.

Another option is to append button element to the page using JavaScript or modify viewer's HTML template - Providing Custom Templates.

I hope this information would help.


Regards,
Katia
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
0
Mark
Top achievements
Rank 1
answered on 06 Apr 2017, 02:12 PM

 i  decided  to go with  Interactive Action . However  i need to use the Custom action so as to pass parameter values from the server back to the client. custom function 

my problem is how to get this parameters on HTML5 reportviewer. something like this

    interactiveActionEnter: function(e, args) {         
                            $(args.element).css('color', 'green');
                          
                            GlobalObjectData = $(args.action.parameters);
                            $(args.element).attr("onclick", "alert('"+parameter1+"',""parameter2")");
                        },

thanks in advance

0
Stef
Telerik team
answered on 11 Apr 2017, 11:43 AM
Hello Mark,

Please check the code snippet (Example) in the Custom Action help article:
var customAction = args.Action as Telerik.Reporting.Processing.CustomAction;
   if (null != customAction)
   {
       foreach (var p in customAction.Parameters)
       {
           strB.AppendLine(string.Format("Parameter \"{0}\" value: {1}", p.Key, p.Value));
       }
   }
The key is the name of the parameter and the Value attribute will give you the evaluated value of the parameter.

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
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Katia
Telerik team
Mark
Top achievements
Rank 1
Stef
Telerik team
Share this question
or