Skip to content

Page Operations

liavZayde edited this page May 19, 2020 · 6 revisions



Page Operations APIs

With page operations API you can add and delete pages from a report during an embed session.

Add Page

Add a new page to the report.

Definition

/**
* @param displayName - set the display name for the new page.
*                      If not specified the display name would be Page#<NUM>
* @returns {Promise<Page>}
*/
addPage(displayName?: string): Promise<Page>;

The function returns a Page instance of the created page.

Code samples

report.addPage("Sales").then((newPage) => {
    ...
});

Delete Page

Delete a page from the report

Definition

Using a report instance:

/**
* @param pageName - pageName is a unique identifier that's different
*                   from the display name and can be acquired from the getPages API
* @returns {Promise<void>}
*/
deletePage(pageName: string): Promise<void>;

Using a page instance:

/**
* @returns {Promise<void>}
*/
delete(): Promise<void>;

The returned value is resolved after the page is deleted.

Code samples

Using a report instance:

report.deletePage("ReportSection42a34dd163bc0cd05980").then(() => {
    // "ReportSection42a34dd163bc0cd05980" is an example for a pageName taken from the getPages API
    ...
});

Using a page instance:

newPage.delete();

Limitations

Page operations will work only after the report is loaded.