Add an empty page to the report
// Add a page to the report with "Sales" as the page display name
report.addPage("Sales");
Apply a theme to the report
report.applyTheme(theme);
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();
Handle config changes.
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");
Requests the browser to exit fullscreen mode.
Requests the browser to render the component's iframe in fullscreen mode.
Get the correlationId for the current embed session.
// Get the correlationId for the current embed session
report.getCorrelationId()
.then(correlationId => {
...
});
Gets filters that are applied to the filter level. Default filter level is visual level.
visual.getFilters(filtersLevel)
.then(filters => {
...
});
Gets the report ID from the first available location: options, attribute, embed url.
Gets the list of pages within the report - not supported in visual
Gets the embedded visual descriptor object that contains the visual name, type, etc.
visual.getVisualDescriptor()
.then(visualDetails => { ... });
checks if the report is saved.
report.isSaved()
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);
Adds an event handler for a specific event.
report.on('pageChanged', (event) => {
console.log('PageChanged: ', event.page.name);
});
Prints the active page of the report by invoking window.print()
on the embed iframe component.
Refreshes data sources for the report.
report.refresh();
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();
Removes element's tabindex attribute
Removes all filters from the current filter level. Default filter level is visual level.
visual.removeFilters(filtersLevel);
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");
Reset user's filters, slicers, and other data view changes to the default state of the report
report.resetPersistentFilters();
Reset and apply the default theme of the report
report.resetTheme();
Saves Report.
SaveAs Report.
Save user's filters, slicers, and other data view changes of the report
report.savePersistentFilters();
Set accessToken.
Sets element's tabindex attribute
Set the component title for accessibility. In case of iframes, this method will change the iframe title.
Sets filters at the filter level. Default filter level is visual level.
const filters: [
...
];
visual.setFilters(filters, filtersLevel)
.catch(errors => {
...
});
Sets the active page of the report - not supported in visual
Switch Report view mode.
Updates filters at the filter level. Default filter level is visual level.
const filters: [
...
];
visual.updateFilters(FiltersOperations.Add, filters, filtersLevel)
.catch(errors => {
...
});
Updates visibility settings for the filter pane and the page navigation pane.
const newSettings = {
panes: {
filters: {
visible: false
}
}
};
report.updateSettings(newSettings)
.catch(error => { ... });
Generated using TypeDoc
The Power BI Visual embed component
Visual