This method initializes the Dashboard Viewer options and returns the object for rendering the dashboard.
Example
var dashboard = BoldBI.create({
serverUrl: "http://localhost:51777/bi/site/site1",
mode: BoldBI.Mode.Design,
dashboardId: "755e99c7-f858-4058-958b-67577b283309",
embedContainerId: "dashboard_container",// This should be the container id where you want to embed the dashboard
authorizationServer: {
url: "http://example.come/authorize/server"
}
});
NOTE: By default,
BoldBI.Environment.Enterprise
is used for the Environment API member. For Cloud sites, you must set the Environment member value toBoldBI.Environment.Cloud
.
This method will create the dashboard designer based on the dashboard options provided when calling the create method.
Example
var dashboard = BoldBI.create(options);
dashboard.loadDesigner();
This method will return the object of the rendered dashboard using the container ID assigned to the dashboard options.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
This method will destroy the dashboard based on the provided dashboard object when calling the create method.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.dispose();
This method is used to resize the current dashboard.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.viewer.resize();
This method is used to publish the dashboard to the server with the specified dashboard name, category, and desired dashboard name.
Parameter | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
publishModel |
object |
This object contains the following Parameters:
|
||||||||||||
containerId |
string |
Set the embed container id. |
Example for Save the new dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
// For Save the New Dashboard case, Dashboard Id value is not needed
var publishModel = {category: "Sales",categoryId: "e6ed2f36-7205-423e-81e0-38a8ceb8e68c",description: "Published Using API",isPublic: false,name: "Publish API_01"}
instance.designer.publish(publishModel, containerId);
Example for Save the existing dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
// For Save the Existing Dashboard case, Dashboard Id value is needed
var publishModel = {category: "Sales",categoryId: "e6ed2f36-7205-423e-81e0-38a8ceb8e68c",description: "Published Using API",id: '451e17e5-e59f-4090-84a2-cf5537876e59',isPublic: false,name: "Publish API_01"}
instance.designer.publish(publishModel, containerId);
Example for SaveAs the existing dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
// For SaveAs the existing Dashboard case, Dashboard Id value is not needed
var publishModel = {category: "Sales",categoryId: "e6ed2f36-7205-423e-81e0-38a8ceb8e68c",description: "Published Using API",isPublic: false,name: "Publish API_01"}
instance.designer.publish(publishModel, containerId);
NOTE: Please customize the
publish()
function in the dashboard designer using the web application. For more details, please refer to this documentation.
This method will apply or refresh the styles of the dashboard, which was created using the embed container Id.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.applyStyles();
This method will remove the styles applied from the dashboard, which were created using the embed container Id.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.removeStyles();