We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to hide export menu in Dashboard Viewer using JavaScript API

To hide the Export Excel option in the Dashboard Viewer, follow the given steps:

  1. Hide the Export Excel option in the dashboard menu:

To remove the Export Excel option in the Dashboard Viewer through the menu, use the beforeDashboardMenuOpen event as shown in the following code snippet:

$("#dashboard").ejDashboardViewer({

            Serviceurl:‘Service URL’,

            dashboardPath:‘Path of the Dashboard’,

            beforeDashboardMenuOpen: function (args) {    

                for (var i = 0; i < args.menuData.length; i++) {

                    if (args.menuData[i].id === 13) { //Where 13 denotes that Excel menu item

                        args.menuData.splice(i, 1); // To remove the excel option alone from the menu

                        break;

                    }

                }

            }

        });

 

The following screenshot illustrates the result of the above code snippet:

 

  1. Hide the Export Excel option in the context menu of the dashboard widget:

To remove anyone of the exporting options in the Context Menu, use the beforeContextMenuOpen event. Refer to the following code snippet to remove the Export Excel option from the Context Menu of a dashboard widget:

$("#dashboard").ejDashboardViewer({

     Serviceurl:‘Service URL’,

            dashboardPath:‘Path of the Dashboard’,

             beforeContextMenuOpen: function (args) {            

                for (var i = 0; i < args.menuData.length; i++) {

                    if (args.menuData[i].id === 14 && args.menuData[i].parentId === 11) { //Where 14 denotes the Excel menu and 11 denotes the Parent menu

                        args.menuData.splice(i, 1); // Remove the excel option

                        break;

                    }

                }

            }

        });

 

 

The following screenshot illustrates the result of the above code snippet:

 

  1. Hide the Export Excel option in the dashboard widget menu:

To remove anyone of the exporting options in the dashboard widget menu, use the beforeControlMenuOpen event. Refer to the following code snippet to remove the Export Excel option from the dashboard widget menu:

$("#dashboard").ejDashboardViewer({

     Serviceurl:‘Service URL’,

            dashboardPath:‘Path of the Dashboard’,

                                  beforeControlMenuOpen: function (args) { 

            for (var i = 0; i < args.menuData.length; i++) { 

                if (args.menuData[i].id === 14 && args.menuData[i].parentId === 11)  //Where 14 denotes the Excel menu and 11 denotes the Parent menu                                                              

                   {

                     args.menuData.splice(i, 1); // Remove the excel option

                     break; 

                      } 

            } 

       }

});

 

 

The following screenshot illustrates the result of the above code snippet:

  1. Hide the Export Excel option in the tab menu of the multi-tabbed dashboard:

To remove anyone of the exporting options in the tab menu of the multi-tabbed dashboard, use the beforeTabMenuCreate event. Refer to the following code snippet to remove the Export Excel option from the tab menu:

$("#dashboard").ejDashboardViewer({

     Serviceurl:‘Service URL’,

     dashboardPath:‘Path of the Dashboard’,

     beforeTabMenuCreate: function(args) {

                for (var i = 0; i < args.menuData.length; i++) {

                    if (args.menuData[i].id === 3) { // Id 13 denotes export excel option

                        args.menuData.splice(i, 1); // Remove the excel option

                        break;

                    }

                }

            }

        });

 

 

The following screenshot illustrates the result of the above code snippet:

      

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8437 02/14/2018 02/14/2018 Dashboard Platform Dashboard Viewer
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.