Steps to hide the Export Excel option in the Dashboard Viewer
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:
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:
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:
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:
|
This page will automatically be redirected to the sign-in page in 10 seconds.