-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisual log extractor (pbi playground).java
More file actions
35 lines (35 loc) · 1.04 KB
/
visual log extractor (pbi playground).java
File metadata and controls
35 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Retrieve the page collection and get the visuals for multiple pages.
try {
const pages = await report.getPages();
// Supply multiple internal page IDs (these correspond to page.name)
const pageIds = [
'Insert page id',
'Insert page id',
];
// Index pages by id for quick lookup
const pagesById = new Map(pages.map(p => [p.name, p]));
for (const pageId of pageIds) {
// Find the page by its internal name (ID)
const page = pagesById.get(pageId);
if (!page) {
console.warn(`Page with ID "${pageId}" not found.`);
continue;
}
const visuals = await page.getVisuals();
console.log({
pageId,
visuals: visuals.map(function (visual) {
return {
pageId: pageId,
name: visual.name,
type: visual.type,
title: visual.title,
layout: visual.layout
};
})
});
}
}
catch (errors) {
console.log(errors);
}