Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Report

The Power BI Report embed component

export
class

Report

extends

{Embed}

implements

{IReportNode}

implements

{IFilterable}

Hierarchy

Implements

Index

Properties

bookmarksManager

bookmarksManager: BookmarksManager

Methods

addPage

  • addPage(displayName?: string): Promise<Page>
  • Add an empty page to the report

    // Add a page to the report with "Sales" as the page display name
    report.addPage("Sales");

    Parameters

    • Optional displayName: string

    Returns Promise<Page>

applyTheme

arePersistentFiltersApplied

  • arePersistentFiltersApplied(): Promise<boolean>
  • 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();

    Returns Promise<boolean>

configChanged

  • configChanged(isBootstrap: boolean): void
  • Handle config changes.

    Parameters

    • isBootstrap: boolean

    Returns void

deletePage

  • deletePage(pageName: string): Promise<void>
  • 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");

    Parameters

    • pageName: string

    Returns Promise<void>

exitFullscreen

  • exitFullscreen(): void
  • Requests the browser to exit fullscreen mode.

    Returns void

fullscreen

  • fullscreen(): void
  • Requests the browser to render the component's iframe in fullscreen mode.

    Returns void

getCorrelationId

  • getCorrelationId(): Promise<string>
  • Get the correlationId for the current embed session.

    // Get the correlationId for the current embed session
    report.getCorrelationId()
      .then(correlationId => {
        ...
      });

    Returns Promise<string>

getFilters

  • Gets filters that are applied at the report level.

    // Get filters applied at report level
    report.getFilters()
      .then(filters => {
        ...
      });

    Returns Promise<IFilter[]>

getId

  • getId(): string
  • Gets the report ID from the first available location: options, attribute, embed url.

    Returns string

getPages

  • getPages(): Promise<Page[]>
  • Gets the list of pages within the report.

    report.getPages()
     .then(pages => {
         ...
     });

    Returns Promise<Page[]>

isSaved

  • isSaved(): Promise<boolean>
  • checks if the report is saved.

    report.isSaved()

    Returns Promise<boolean>

off

  • off<T>(eventName: string, handler?: IEventHandler<T>): void
  • 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);
    template

    T

    Type parameters

    • T

    Parameters

    • eventName: string
    • Optional handler: IEventHandler<T>

    Returns void

on

  • on<T>(eventName: string, handler: IEventHandler<T>): void
  • Adds an event handler for a specific event.

    report.on('pageChanged', (event) => {
      console.log('PageChanged: ', event.page.name);
    });
    template

    T

    Type parameters

    • T

    Parameters

    • eventName: string
    • handler: IEventHandler<T>

    Returns void

print

  • print(): Promise<void>
  • Prints the active page of the report by invoking window.print() on the embed iframe component.

    Returns Promise<void>

refresh

  • refresh(): Promise<void>
  • Refreshes data sources for the report.

    report.refresh();

    Returns Promise<void>

reload

  • reload(): Promise<void>
  • 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();

    Returns Promise<void>

removeComponentTabIndex

  • removeComponentTabIndex(_tabIndex?: number): void
  • Removes element's tabindex attribute

    Parameters

    • Optional _tabIndex: number

    Returns void

removeFilters

  • removeFilters(): Promise<IHttpPostMessageResponse<void>>

renamePage

  • renamePage(pageName: string, displayName: string): Promise<void>
  • 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");

    Parameters

    • pageName: string
    • displayName: string

    Returns Promise<void>

render

resetPersistentFilters

  • resetPersistentFilters(): Promise<IHttpPostMessageResponse<void>>
  • Reset user's filters, slicers, and other data view changes to the default state of the report

    report.resetPersistentFilters();

    Returns Promise<IHttpPostMessageResponse<void>>

resetTheme

  • resetTheme(): Promise<void>
  • Reset and apply the default theme of the report

    report.resetTheme();

    Returns Promise<void>

save

  • save(): Promise<void>
  • Saves Report.

    Returns Promise<void>

saveAs

  • saveAs(saveAsParameters: models.ISaveAsParameters): Promise<void>
  • SaveAs Report.

    Parameters

    • saveAsParameters: models.ISaveAsParameters

    Returns Promise<void>

savePersistentFilters

  • savePersistentFilters(): Promise<IHttpPostMessageResponse<void>>
  • Save user's filters, slicers, and other data view changes of the report

    report.savePersistentFilters();

    Returns Promise<IHttpPostMessageResponse<void>>

setAccessToken

  • setAccessToken(accessToken: string): Promise<void>
  • Set accessToken.

    Parameters

    • accessToken: string

    Returns Promise<void>

setComponentTabIndex

  • setComponentTabIndex(tabIndex?: number): void
  • Sets element's tabindex attribute

    Parameters

    • Optional tabIndex: number

    Returns void

setComponentTitle

  • setComponentTitle(title: string): void
  • Set the component title for accessibility. In case of iframes, this method will change the iframe title.

    Parameters

    • title: string

    Returns void

setFilters

  • setFilters(filters: IFilter[]): Promise<IHttpPostMessageResponse<void>>
  • Sets filters at the report level.

    const filters: [
       ...
    ];
    
    report.setFilters(filters)
     .catch(errors => {
       ...
     });

    Parameters

    Returns Promise<IHttpPostMessageResponse<void>>

setPage

  • setPage(pageName: string): Promise<IHttpPostMessageResponse<void>>
  • Sets the active page of the report.

    report.setPage("page2")
     .catch(error => { ... });

    Parameters

    • pageName: string

    Returns Promise<IHttpPostMessageResponse<void>>

switchMode

  • switchMode(viewMode: ViewMode | string): Promise<void>

updateFilters

  • 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 => { ... });

    Parameters

    Returns Promise<IHttpPostMessageResponse<void>>

updateSettings

  • updateSettings(settings: ISettings): Promise<IHttpPostMessageResponse<void>>
  • Updates visibility settings for the filter pane and the page navigation pane.

    const newSettings = {
      panes: {
        filters: {
          visible: false
        }
      }
    };
    
    report.updateSettings(newSettings)
      .catch(error => { ... });

    Parameters

    Returns Promise<IHttpPostMessageResponse<void>>

Generated using TypeDoc