Properties for an embedded Strategy report page
To embed a Strategy report page into a web page, use the embedReportPage(props)
method under the microstrategy.embeddingContexts
namespace.
Method
microstrategy.embeddingContexts.embedReportPage(props)
This method creates an iFrame on the web page, in the location specified by the placeholder
property, and inserts a link to the Strategy report page URL. The report page URL is built using serverUrl
+ '/app/' + projectId
+ '/' + objectId
+ '/' + pageKey
.
Return value
This method returns a promise, which is resolved when the Strategy report page is loaded.
The props
parameter contains following required key-value pairs:
serverUrl
,projectId
, andobjectId
define the full report page URL.placeholder
specifies where the iFrame containing the Strategy report page will be created.
It can also contain other optional key-value pairs to customize the UI, authentication, and custom error handler.
The props
parameter can contain the following key-value pairs:
Properties
placeholder
Reference for the <div>
container.
Required?
Yes
Default value
N/A
Sample
N/A
serverUrl
,projectId
,objectId
, and pageKey
These properties build the full report page URL to be embedded.
The Embedding SDK builds the URL using serverUrl
+ '/app/' + projectId
+ '/' + objectId
+ '/' + pageKey
.
Required?
serverUrl
,projectId
,objectId
is required, while pageKey
is optional.
Default value
N/A
Sample
const embeddingContext = await microstrategy.embeddingContexts.embedReportPage({
serverUrl: "https://demo.microstrategy.com/MicroStrategyLibrary",
projectId: "B19DEDCC11D4E0EFC000EB9495D0F44F",
objectId: "A409D6EC2245D4417C4FBEA5CD87D3A1",
placeholder: document.getElementById("embedding-report-container"),
});
containerHeight
Sets the height of the placeholder.
If the style of the placeholder has a height value, the containerHeight
property is ignored.
The containerHeight
property is applied as a style: style="height: $(containerHeight)".
Required?
No
Default value
600px
Sample
const embeddingContext = await microstrategy.embeddingContexts.embedReportPage({
serverUrl: "https://demo.microstrategy.com/MicroStrategyLibrary",
projectId: "B19DEDCC11D4E0EFC000EB9495D0F44F",
objectId: "A409D6EC2245D4417C4FBEA5CD87D3A1",
placeholder: document.getElementById("embedding-report-container"),
containerHeight: "600px",
});
containerWidth
Sets the width of the placeholder.
If the style of the placeholder has a width value, the containerWidth
property is ignored.
Required?
No
Default value
800px
Sample
const embeddingContext = await microstrategy.embeddingContexts.embedReportPage({
serverUrl: "https://demo.microstrategy.com/MicroStrategyLibrary",
projectId: "B19DEDCC11D4E0EFC000EB9495D0F44F",
objectId: "A409D6EC2245D4417C4FBEA5CD87D3A1",
placeholder: document.getElementById("embedding-report-container"),
containerWidth: "800px",
});
enableCustomAuthentication
Specifies whether custom authentication is enabled.
Required?
No
Default value
false
The user must log in from the default login page.
Sample
N/A
customAuthenticationType
Specifies the token type returned by the getLoginToken
function. There are two possible values, which can be provided by the CustomAuthenticationType
enumeration.
Required?
No