Page class
A Power BI report page
Properties
background | Page background color. |
default |
Page display options as saved in the report. |
default |
Page size as saved in the report. |
display |
The user defined display name of the report page, which is undefined if the page is created manually |
is |
Is this page is the active page |
mobile |
Mobile view page size (if defined) as saved in the report. |
name | The report page name |
report | The parent Power BI report that this page is a member of |
visibility | The visibility of the page. 0 - Always Visible 1 - Hidden in View Mode |
wallpaper | Page wallpaper color. |
Methods
delete() | Delete the page from the report
|
get |
Gets all page level filters within the report.
|
get |
Gets the list of slicer visuals on the page.
|
get |
Get insights for report page
|
get |
Gets a visual by name on the page.
|
get |
Gets all the visuals on the page.
|
has |
Checks if page has layout.
|
move |
Updates the position of a visual in a page.
|
remove |
Removes all filters from this page of the report.
|
resize |
Updates the size of active page.
|
resize |
Resize a visual in a page.
|
set |
Makes the current page the active page of the report.
|
set |
Set displayName to the current page.
|
set |
Sets all filters on the current page.
|
set |
Updates the display state of a visual in a page.
|
update |
Update the filters for the current page according to the operation: Add, replace all, replace by target or remove.
|
Property Details
background
defaultDisplayOption
Page display options as saved in the report.
defaultDisplayOption: DisplayOption
Property Value
defaultSize
displayName
The user defined display name of the report page, which is undefined if the page is created manually
displayName: string
Property Value
string
isActive
Is this page is the active page
isActive: boolean
Property Value
boolean
mobileSize
Mobile view page size (if defined) as saved in the report.
mobileSize: ICustomPageSize
Property Value
name
The report page name
name: string
Property Value
string
report
The parent Power BI report that this page is a member of
report: IReportNode
Property Value
visibility
The visibility of the page. 0 - Always Visible 1 - Hidden in View Mode
visibility: SectionVisibility
Property Value
wallpaper
Method Details
delete()
Delete the page from the report
// Delete the page from the report
page.delete();
function delete(): Promise<void>
Returns
Promise<void>
getFilters()
Gets all page level filters within the report.
page.getFilters()
.then(filters => { ... });
function getFilters(): Promise<IFilter[]>
Returns
Promise<IFilter[]>
getSlicers()
Gets the list of slicer visuals on the page.
page.getSlicers()
.then(slicers => {
...
});
function getSlicers(): Promise<IVisual[]>
Returns
Promise<IVisual[]>
getSmartNarrativeInsights()
Get insights for report page
page.getSmartNarrativeInsights();
function getSmartNarrativeInsights(): Promise<ISmartNarratives>
Returns
Promise<ISmartNarratives>
getVisualByName(string)
Gets a visual by name on the page.
page.getVisualByName(visualName: string)
.then(visual => {
...
});
function getVisualByName(visualName: string): Promise<VisualDescriptor>
Parameters
- visualName
-
string
Returns
Promise<VisualDescriptor>
getVisuals()
Gets all the visuals on the page.
page.getVisuals()
.then(visuals => { ... });
function getVisuals(): Promise<VisualDescriptor[]>
Returns
Promise<VisualDescriptor[]>
hasLayout(LayoutType)
Checks if page has layout.
page.hasLayout(layoutType)
.then(hasLayout: boolean => { ... });
function hasLayout(layoutType: LayoutType): Promise<boolean>
Parameters
- layoutType
- LayoutType
Returns
Promise<boolean>
moveVisual(string, number, number, number)
Updates the position of a visual in a page.
page.moveVisual(visualName, x, y, z)
.catch(error => { ... });
function moveVisual(visualName: string, x: number, y: number, z?: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- visualName
-
string
- x
-
number
- y
-
number
- z
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
removeFilters()
Removes all filters from this page of the report.
page.removeFilters();
function removeFilters(): Promise<IHttpPostMessageResponse<void>>
Returns
Promise<IHttpPostMessageResponse<void>>
resizePage(PageSizeType, number, number)
Updates the size of active page.
page.resizePage(pageSizeType, width, height)
.catch(error => { ... });
function resizePage(pageSizeType: PageSizeType, width?: number, height?: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- pageSizeType
- PageSizeType
- width
-
number
- height
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
resizeVisual(string, number, number)
Resize a visual in a page.
page.resizeVisual(visualName, width, height)
.catch(error => { ... });
function resizeVisual(visualName: string, width: number, height: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- visualName
-
string
- width
-
number
- height
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
setActive()
Makes the current page the active page of the report.
page.setActive();
function setActive(): Promise<IHttpPostMessageResponse<void>>
Returns
Promise<IHttpPostMessageResponse<void>>
setDisplayName(string)
Set displayName to the current page.
page.setName(displayName);
function setDisplayName(displayName: string): Promise<IHttpPostMessageResponse<void>>
Parameters
- displayName
-
string
Returns
Promise<IHttpPostMessageResponse<void>>
setFilters(IFilter[])
Sets all filters on the current page.
page.setFilters(filters)
.catch(errors => { ... });
function setFilters(filters: IFilter[]): Promise<IHttpPostMessageResponse<void>>
Parameters
- filters
-
IFilter[]
Returns
Promise<IHttpPostMessageResponse<void>>
setVisualDisplayState(string, VisualContainerDisplayMode)
Updates the display state of a visual in a page.
page.setVisualDisplayState(visualName, displayState)
.catch(error => { ... });
function setVisualDisplayState(visualName: string, displayState: VisualContainerDisplayMode): Promise<IHttpPostMessageResponse<void>>
Parameters
- visualName
-
string
- displayState
- VisualContainerDisplayMode
Returns
Promise<IHttpPostMessageResponse<void>>
updateFilters(FiltersOperations, IFilter[])
Update the filters for the current page according to the operation: Add, replace all, replace by target or remove.
page.updateFilters(FiltersOperations.Add, filters)
.catch(errors => { ... });
function updateFilters(operation: FiltersOperations, filters?: IFilter[]): Promise<IHttpPostMessageResponse<void>>
Parameters
- operation
- FiltersOperations
- filters
-
IFilter[]
Returns
Promise<IHttpPostMessageResponse<void>>