How to Control Export Options visibilty in JavaScript Embedded Dashboards?
When embedding dashboards into your application, it’s often necessary to control which users have access to certain features, such as exporting data. The JavaScript embedding API provided by Bold BI allows for granular control over the visibility of export options within an embedded dashboard.
Controlling Export Visibility
To manage the export options, you can utilize the dashboardSettings
, widgetSettings
and exportSettings
properties within the JavaScript API. These settings enable you to show or hide the entire export option of dashboard/widgets or specific export formats like CSV, Excel, Image, and PDF.
Example code: Hiding Dashboard’s Export Options
Based on the user can set this property showExport
property to true
/ false
within the dashboardSettings
:
this.dashboard = BoldBI.create({
dashboardSettings: {
showExport: false, // Set to false to hide the dashboard's export option
},
});
Example code: Hiding Specific Export Options
If you need to hide specific export options, such as Excel, you can use the exportSettings
object:
function renderDashboard() {
this.dashboard = BoldBI.create({
exportSettings: {
showExcel: false, // Set to false to hide the Excel export option
},
});
}
Example code: Hiding Widgets Export Options
If you need to hide widgets export options, you can set this property showExport
property to true
/ false
within the widgetSettings
function renderDashboard() {
this.dashboard = BoldBI.create({
widgetSettings: {
showExport: false, // Set to false to hide the widget's export option
}
});
}
By setting the appropriate properties to true
or false
, you can customize the export capabilities based on user roles or permissions within your application.
Additional References
For more detailed information on embedding options and the JavaScript API reference, please visit the following links: