Skip to main content

Embedded Methods

This applies to: Managed Dashboards, Managed Reports

After creating the embedded application object, you can access the following methods on it. See Application Properties for information on properties to use.

NameDescriptionExample
loadLoads the embedded application frame according to the properties that have been set.
var dundasBIUrl = 'https://placeholder.dundas-bi-url.com/'; var embedOptions = { dundasBIUrl: dundasBIUrl, controllerType: dundas.embed.ControllerType.DASHBOARD, fileSystemId: 'f22ce55f-04cd-4207-9dd7-2cadeb44b96c' }; // Create the embedded application object. var dundasApp = dundas.embed.create( document.getElementById('dundasBI2'), embedOptions ); // * Load the application * dundasApp.load();
loadAndCreateShortLink

Creates a shortlink that includes the current parameterValues property setting and uses this link to load the embedded application frame rather than specifying values directly in the query string. CORS is required to call this method.

Parameters: options (properties: logOnTokenId, sessionToken, deleteOtherSessions)

var dundasBIUrl = 'https://placeholder.dundas-bi-url.com/'; var logonToken1 = '1fb29869-b276-41ab-9cbd-098d17b675b4'; var logonToken2 = 'cb316db8-5b6d-488f-8c31-fa20c8d66524'; var embedOptions = { dundasBIUrl: dundasBIUrl, controllerType: dundas.embed.ControllerType.DASHBOARD, fileSystemId: 'f22ce55f-04cd-4207-9dd7-2cadeb44b96c', logonTokenId: logonToken1 }; // Create the embedded application object. var dundasApp = dundas.embed.create( document.getElementById('dundasBI2'), embedOptions ); var logOnOptions = { logOnTokenId: logonToken2, deleteOtherSessions: true }; // * Load the application * dundasApp.loadAndCreateShortLink(logOnOptions);
loaded

Handles when the embedded application is first loaded.

Parameters: loadedFunction (Function)

var dundasBIUrl = 'https://placeholder.dundas-bi-url.com/'; var embedOptions = { dundasBIUrl: dundasBIUrl, controllerType: dundas.embed.ControllerType.DASHBOARD, fileSystemId: 'f22ce55f-04cd-4207-9dd7-2cadeb44b96c' }; // Create the embedded application object. var dundasApp = dundas.embed.create( document.getElementById('dundasBI2'), embedOptions ); // * Pass a function to the loaded function * dundasApp.loaded(function() { alert('Dashboard is Loaded'); }); // Load the application dundasApp.load();
ready

Handles when the embedded application is ready after page load. CORS is required to call this method.

Parameters: readyFunction (Function)

var dundasBIUrl = 'https://placeholder.dundas-bi-url.com/'; var embedOptions = { dundasBIUrl: dundasBIUrl, controllerType: dundas.embed.ControllerType.DASHBOARD, fileSystemId: 'f22ce55f-04cd-4207-9dd7-2cadeb44b96c' }; // Create the embedded application object. var dundasApp = dundas.embed.create( document.getElementById('dundasBI2'), embedOptions ); // * Pass a function to the ready function * dundasApp.ready(function() { alert('Dashboard is Ready'); }); // Load the application dundasApp.load();
refresh Refreshes the embedded application content.
var dundasBIUrl = 'https://placeholder.dundas-bi-url.com/'; var embedOptions = { dundasBIUrl: dundasBIUrl, controllerType: dundas.embed.ControllerType.DASHBOARD, fileSystemId: 'f22ce55f-04cd-4207-9dd7-2cadeb44b96c' }; // Create the embedded application object. var dundasApp = dundas.embed.create( document.getElementById('dundasBI2'), embedOptions ); // * Refresh the embedded application * dundasApp.refresh();
runScript

Runs JavaScript within the Dundas BI embedded application in the browser. CORS is required to call this method.

Parameters: script (String), isASync (Boolean, optional), messageReceivedFunction (Function, optional)

var dundasBIUrl = 'https://placeholder.dundas-bi-url.com/'; var embedOptions = { dundasBIUrl: dundasBIUrl, controllerType: dundas.embed.ControllerType.DASHBOARD, fileSystemId: 'f22ce55f-04cd-4007-9dd7-2aedeb44b96c' }; // Create the embedded application object. var dundasApp = dundas.embed.create( document.getElementById('dundasBI2'), embedOptions ); dundasApp.ready(function (e) { // * Pop up a hello ready dialog. dundasApp.runScript( "var viewService = " + " dundas.context.getService('ViewService'); " + "viewService.showSignal(" + "'Ready'," + "dundas.view.NotifyType.INFO," + "'Hello Ready'" + ");" ); // * Run script and send message back, // and handle it with function that accepts message. dundasApp.runScript( "dundas.embed.sendMessageToDundasEmbeddedApplication(" + "dundas.context.currentSessionId" + ");", false, function (message) { alert(message.detail); } ); });

Was this article helpful?

We're sorry to hear that.

Powered by Zendesk