-
Notifications
You must be signed in to change notification settings - Fork 471
Page Operations
Amit Shuster edited this page May 19, 2020
·
6 revisions
With page operations API you can add and delete pages from a report during an embed session.
Add a new page to the report.
/**
* @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.
report.addPage("Sales").then((newPage) => {
...
});
Delete a page from the report
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.
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();
Page operations will work only after the report is loaded.