Report class
The Power BI Report embed component
- Extends
-
Embed
Properties
bookmarks |
Methods
add |
Add context menu extension command.
|
add |
Add options menu extension command.
|
add |
Add an empty page to the report
|
apply |
Apply a theme to the report
|
are |
Returns if there are user's filters, slicers, or other data view changes applied on the report. If persistent filters is disable, returns false.
|
clear |
Clears selected not popped out visuals, if flag is passed, all visuals selections will be cleared.
|
close |
Closes all open context menus and tooltips.
|
config |
Handle config changes. |
delete |
Delete a page from a report
|
get |
Gets the active report page.
|
get |
Gets filters that are applied at the report level.
|
get |
Gets the report ID from the first available location: options, attribute, embed url. |
get |
Gets a report page by its name.
|
get |
Gets the list of pages within the report.
|
get |
get the theme of the report
|
get |
Return the current zoom level of the report. |
is |
checks if the report is saved.
|
move |
Updates the position of a visual in a page.
|
print() | Prints the active page of the report by invoking |
refresh() | Refreshes data sources for the report.
|
remove |
Remove context menu extension command.
|
remove |
Removes all filters at the report level.
|
remove |
Remove options menu extension command.
|
rename |
Rename a page from a report
|
render(IReport |
Render a preloaded report, using phased embedding API
|
reset |
Reset user's filters, slicers, and other data view changes to the default state of the report
|
reset |
Reset and apply the default theme of the report
|
resize |
Updates the size of active page in report.
|
resize |
Resize a visual in a page.
|
save |
Save user's filters, slicers, and other data view changes of the report
|
set |
Sets filters at the report level.
|
set |
Sets the active page of the report.
|
set |
Updates the display state of a visual in a page.
|
set |
Sets the report's zoom level. |
switch |
Updates the report layout
|
switch |
Switch Report view mode. |
update |
Update the filters at the report level according to the operation: Add, replace all, replace by target or remove.
|
update |
Updates visibility settings for the filter pane and the page navigation pane.
|
Inherited Methods
exit |
Requests the browser to exit fullscreen mode. |
fullscreen() | Requests the browser to render the component's iframe in fullscreen mode. |
get |
Get the correlationId for the current embed session.
|
off<T>(string, IEvent |
Removes one or more event handlers from the list of handlers. If a reference to the existing handle function is specified, remove the specific handler. If the handler is not specified, remove all handlers for the event name specified.
|
on<T>(string, IEvent |
Adds an event handler for a specific event.
|
reload() | Reloads embed using existing configuration. E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.
|
remove |
Removes element's tabindex attribute |
save() | Saves Report. |
save |
SaveAs Report. |
set |
Set accessToken. |
set |
Sets element's tabindex attribute |
set |
Set the component title for accessibility. In case of iframes, this method will change the iframe title. |
Property Details
bookmarksManager
Method Details
addContextMenuCommand(string, string, string, MenuLocation, string, string, string)
Add context menu extension command.
report.addContextMenuCommand(commandName, commandTitle, contextMenuTitle, menuLocation, visualName, visualType, groupName)
.catch(error => {
...
});
function addContextMenuCommand(commandName: string, commandTitle: string, contextMenuTitle: string, menuLocation: MenuLocation, visualName: string, visualType: string, groupName?: string): Promise<IHttpPostMessageResponse<void>>
Parameters
- commandName
-
string
- commandTitle
-
string
- contextMenuTitle
-
string
- menuLocation
- MenuLocation
- visualName
-
string
- visualType
-
string
- groupName
-
string
Returns
Promise<IHttpPostMessageResponse<void>>
addOptionsMenuCommand(string, string, string, MenuLocation, string, string, string, string)
Add options menu extension command.
report.addOptionsMenuCommand(commandName, commandTitle, optionsMenuTitle, menuLocation, visualName, visualType, groupName, commandIcon)
.catch(error => {
...
});
function addOptionsMenuCommand(commandName: string, commandTitle: string, optionsMenuTitle?: string, menuLocation?: MenuLocation, visualName?: string, visualType?: string, groupName?: string, commandIcon?: string): Promise<IHttpPostMessageResponse<void>>
Parameters
- commandName
-
string
- commandTitle
-
string
- optionsMenuTitle
-
string
- menuLocation
- MenuLocation
- visualName
-
string
- visualType
-
string
- groupName
-
string
- commandIcon
-
string
Returns
Promise<IHttpPostMessageResponse<void>>
addPage(string)
Add an empty page to the report
// Add a page to the report with "Sales" as the page display name
report.addPage("Sales");
function addPage(displayName?: string): Promise<Page>
Parameters
- displayName
-
string
Returns
Promise<Page>
applyTheme(IReportTheme)
Apply a theme to the report
report.applyTheme(theme);
function applyTheme(theme: IReportTheme): Promise<void>
Parameters
- theme
- IReportTheme
Returns
Promise<void>
arePersistentFiltersApplied()
Returns if there are user's filters, slicers, or other data view changes applied on the report. If persistent filters is disable, returns false.
report.arePersistentFiltersApplied();
function arePersistentFiltersApplied(): Promise<boolean>
Returns
Promise<boolean>
clearSelectedVisuals(boolean)
Clears selected not popped out visuals, if flag is passed, all visuals selections will be cleared.
report.clearSelectedVisuals()
.then(() => {
...
});
function clearSelectedVisuals(clearPopOutState?: boolean): Promise<void>
Parameters
- clearPopOutState
-
boolean
If false / undefined visuals selection will not be cleared if one of visuals is in popped out state (in focus, show as table, spotlight...)
Returns
Promise<void>
closeAllOverlays()
Closes all open context menus and tooltips.
report.closeAllOverlays()
.then(() => {
...
});
function closeAllOverlays(): Promise<void>
Returns
Promise<void>
configChanged(boolean)
Handle config changes.
function configChanged(isBootstrap: boolean)
Parameters
- isBootstrap
-
boolean
deletePage(string)
Delete a page from a report
// Delete a page from a report by pageName (PageName is different than the display name and can be acquired from the getPages API)
report.deletePage("ReportSection145");
function deletePage(pageName: string): Promise<void>
Parameters
- pageName
-
string
Returns
Promise<void>
getActivePage()
Gets the active report page.
report.getActivePage()
.then(activePage => {
...
});
function getActivePage(): Promise<Page>
Returns
Promise<Page>
getFilters()
Gets filters that are applied at the report level.
// Get filters applied at report level
report.getFilters()
.then(filters => {
...
});
function getFilters(): Promise<IFilter[]>
Returns
Promise<IFilter[]>
getId()
Gets the report ID from the first available location: options, attribute, embed url.
function getId(): string
Returns
string
getPageByName(string)
Gets a report page by its name.
report.getPageByName(pageName)
.then(page => {
...
});
function getPageByName(pageName: string): Promise<Page>
Parameters
- pageName
-
string
Returns
Promise<Page>
getPages()
Gets the list of pages within the report.
report.getPages()
.then(pages => {
...
});
function getPages(): Promise<Page[]>
Returns
Promise<Page[]>
getTheme()
get the theme of the report
report.getTheme();
function getTheme(): Promise<IReportTheme>
Returns
Promise<IReportTheme>
getZoom()
Return the current zoom level of the report.
function getZoom(): Promise<number>
Returns
Promise<number>
isSaved()
checks if the report is saved.
report.isSaved()
function isSaved(): Promise<boolean>
Returns
Promise<boolean>
moveVisual(string, string, number, number, number)
Updates the position of a visual in a page.
report.moveVisual(pageName, visualName, x, y, z)
.catch(error => { ... });
function moveVisual(pageName: string, visualName: string, x: number, y: number, z?: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- pageName
-
string
- visualName
-
string
- x
-
number
- y
-
number
- z
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
print()
Prints the active page of the report by invoking window.print()
on the embed iframe component.
function print(): Promise<void>
Returns
Promise<void>
refresh()
Refreshes data sources for the report.
report.refresh();
function refresh(): Promise<void>
Returns
Promise<void>
removeContextMenuCommand(string, string)
Remove context menu extension command.
report.removeContextMenuCommand(commandName, contextMenuTitle)
.catch(error => {
...
});
function removeContextMenuCommand(commandName: string, contextMenuTitle: string): Promise<IHttpPostMessageResponse<void>>
Parameters
- commandName
-
string
- contextMenuTitle
-
string
Returns
Promise<IHttpPostMessageResponse<void>>
removeFilters()
Removes all filters at the report level.
report.removeFilters();
function removeFilters(): Promise<IHttpPostMessageResponse<void>>
Returns
Promise<IHttpPostMessageResponse<void>>
removeOptionsMenuCommand(string, string)
Remove options menu extension command.
report.removeOptionsMenuCommand(commandName, optionsMenuTitle)
.then({
...
});
function removeOptionsMenuCommand(commandName: string, optionsMenuTitle: string): Promise<IHttpPostMessageResponse<void>>
Parameters
- commandName
-
string
- optionsMenuTitle
-
string
Returns
Promise<IHttpPostMessageResponse<void>>
renamePage(string, string)
Rename a page from a report
// Rename a page from a report by changing displayName (pageName is different from the display name and can be acquired from the getPages API)
report.renamePage("ReportSection145", "Sales");
function renamePage(pageName: string, displayName: string): Promise<void>
Parameters
- pageName
-
string
- displayName
-
string
Returns
Promise<void>
render(IReportEmbedConfiguration | IReportLoadConfiguration)
Render a preloaded report, using phased embedding API
// Load report
var report = powerbi.load(element, config);
...
// Render report
report.render()
function render(config?: IReportEmbedConfiguration | IReportLoadConfiguration): Promise<void>
Parameters
Returns
Promise<void>
resetPersistentFilters()
Reset user's filters, slicers, and other data view changes to the default state of the report
report.resetPersistentFilters();
function resetPersistentFilters(): Promise<IHttpPostMessageResponse<void>>
Returns
Promise<IHttpPostMessageResponse<void>>
resetTheme()
Reset and apply the default theme of the report
report.resetTheme();
function resetTheme(): Promise<void>
Returns
Promise<void>
resizeActivePage(PageSizeType, number, number)
Updates the size of active page in report.
report.resizeActivePage(pageSizeType, width, height)
.catch(error => { ... });
function resizeActivePage(pageSizeType: PageSizeType, width?: number, height?: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- pageSizeType
- PageSizeType
- width
-
number
- height
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
resizeVisual(string, string, number, number)
Resize a visual in a page.
report.resizeVisual(pageName, visualName, width, height)
.catch(error => { ... });
function resizeVisual(pageName: string, visualName: string, width: number, height: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- pageName
-
string
- visualName
-
string
- width
-
number
- height
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
savePersistentFilters()
Save user's filters, slicers, and other data view changes of the report
report.savePersistentFilters();
function savePersistentFilters(): Promise<IHttpPostMessageResponse<void>>
Returns
Promise<IHttpPostMessageResponse<void>>
setFilters(IFilter[])
Sets filters at the report level.
const filters: [
...
];
report.setFilters(filters)
.catch(errors => {
...
});
function setFilters(filters: IFilter[]): Promise<IHttpPostMessageResponse<void>>
Parameters
- filters
-
IFilter[]
Returns
Promise<IHttpPostMessageResponse<void>>
setPage(string)
Sets the active page of the report.
report.setPage("page2")
.catch(error => { ... });
function setPage(pageName: string): Promise<IHttpPostMessageResponse<void>>
Parameters
- pageName
-
string
Returns
Promise<IHttpPostMessageResponse<void>>
setVisualDisplayState(string, string, VisualContainerDisplayMode)
Updates the display state of a visual in a page.
report.setVisualDisplayState(pageName, visualName, displayState)
.catch(error => { ... });
function setVisualDisplayState(pageName: string, visualName: string, displayState: VisualContainerDisplayMode): Promise<IHttpPostMessageResponse<void>>
Parameters
- pageName
-
string
- visualName
-
string
- displayState
- VisualContainerDisplayMode
Returns
Promise<IHttpPostMessageResponse<void>>
setZoom(number)
Sets the report's zoom level.
function setZoom(zoomLevel: number): Promise<void>
Parameters
- zoomLevel
-
number
zoom level to set
Returns
Promise<void>
switchLayout(LayoutType)
Updates the report layout
report.switchLayout(layoutType);
function switchLayout(layoutType: LayoutType): Promise<IHttpPostMessageResponse<void>>
Parameters
- layoutType
- LayoutType
Returns
Promise<IHttpPostMessageResponse<void>>
switchMode(string | ViewMode)
Switch Report view mode.
function switchMode(viewMode: string | ViewMode): Promise<void>
Parameters
- viewMode
-
string | ViewMode
Returns
Promise<void>
updateFilters(FiltersOperations, IFilter[])
Update the filters at the report level according to the operation: Add, replace all, replace by target or remove.
report.updateFilters(FiltersOperations.Add, filters)
.catch(errors => { ... });
function updateFilters(operation: FiltersOperations, filters?: IFilter[]): Promise<IHttpPostMessageResponse<void>>
Parameters
- operation
- FiltersOperations
- filters
-
IFilter[]
Returns
Promise<IHttpPostMessageResponse<void>>
updateSettings(ISettings)
Updates visibility settings for the filter pane and the page navigation pane.
const newSettings = {
panes: {
filters: {
visible: false
}
}
};
report.updateSettings(newSettings)
.catch(error => { ... });
function updateSettings(settings: ISettings): Promise<IHttpPostMessageResponse<void>>
Parameters
- settings
- ISettings
Returns
Promise<IHttpPostMessageResponse<void>>
Inherited Method Details
exitFullscreen()
Requests the browser to exit fullscreen mode.
function exitFullscreen()
Inherited From Embed.exitFullscreen
fullscreen()
Requests the browser to render the component's iframe in fullscreen mode.
function fullscreen()
Inherited From Embed.fullscreen
getCorrelationId()
Get the correlationId for the current embed session.
// Get the correlationId for the current embed session
report.getCorrelationId()
.then(correlationId => {
...
});
function getCorrelationId(): Promise<string>
Returns
Promise<string>
Inherited From Embed.getCorrelationId
off<T>(string, IEventHandler<T>)
Removes one or more event handlers from the list of handlers. If a reference to the existing handle function is specified, remove the specific handler. If the handler is not specified, remove all handlers for the event name specified.
report.off('pageChanged')
or
const logHandler = function (event) {
console.log(event);
};
report.off('pageChanged', logHandler);
function off<T>(eventName: string, handler?: IEventHandler<T>)
Parameters
- eventName
-
string
- handler
-
IEventHandler<T>
Inherited From Embed.off
on<T>(string, IEventHandler<T>)
Adds an event handler for a specific event.
report.on('pageChanged', (event) => {
console.log('PageChanged: ', event.page.name);
});
function on<T>(eventName: string, handler: IEventHandler<T>)
Parameters
- eventName
-
string
- handler
-
IEventHandler<T>
Inherited From Embed.on
reload()
Reloads embed using existing configuration. E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.
report.reload();
function reload(): Promise<void>
Returns
Promise<void>
Inherited From Embed.reload
removeComponentTabIndex(number)
Removes element's tabindex attribute
function removeComponentTabIndex(_tabIndex?: number)
Parameters
- _tabIndex
-
number
Inherited From Embed.removeComponentTabIndex
save()
Saves Report.
function save(): Promise<void>
Returns
Promise<void>
Inherited From Embed.save
saveAs(ISaveAsParameters)
SaveAs Report.
function saveAs(saveAsParameters: ISaveAsParameters): Promise<void>
Parameters
- saveAsParameters
- ISaveAsParameters
Returns
Promise<void>
Inherited From Embed.saveAs
setAccessToken(string)
Set accessToken.
function setAccessToken(accessToken: string): Promise<void>
Parameters
- accessToken
-
string
Returns
Promise<void>
Inherited From Embed.setAccessToken
setComponentTabIndex(number)
Sets element's tabindex attribute
function setComponentTabIndex(tabIndex?: number)
Parameters
- tabIndex
-
number
Inherited From Embed.setComponentTabIndex
setComponentTitle(string)
Set the component title for accessibility. In case of iframes, this method will change the iframe title.
function setComponentTitle(title: string)
Parameters
- title
-
string
Inherited From Embed.setComponentTitle