如何解决Power BI如何隐藏默认页面选项卡并获取报告的可用页面列表
我正在尝试在Power BI中为每个报表实现一些自定义页面导航。我正在尝试获取报告页面的列表,以便可以在我的自定义标签中循环浏览这些页面。 report.getPages().then(pages => { console.log("in the getpages .then"); console.log(pages)return pages; });
这是我的代码,我不确定为什么诺言一旦解决,我就无法登录页面。在这方面的任何帮助表示赞赏。谢谢!
解决方法
我刚刚使用Power BI Embedded Playground->示例报告测试了此功能,这是测试SDK功能的好方法。
以下代码段可以正常运行,并且由Power BI Embedded Playground提供。
// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];
// Get a reference to the embedded report.
report = powerbi.get(embedContainer);
// Retrieve the page collection and loop through to collect the
// page name and display name of each page and display the value.
report.getPages()
.then(function (pages) {
var log = "Report pages:";
pages.forEach(function (page) {
log += "\n" + page.name + " - " + page.displayName;
});
Log.logText(log);
})
.catch(function (error) {
Log.log(error);
});
> Loaded
> Report pages:
> ReportSectioneb8c865100f8508cc533 - Tiles
ReportSection600dd9293d71ade01765 - Market Share
ReportSectiona271643cba2213c935be - YTD Category
ReportSection1c45b5dc6513ae89b4e3 - Sentiment
ReportSection2ff5a27ac612830bbd93 - Tooltip
ReportSection6da8317ad6cbcae5b3bb - Empty Page
> Rendered
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。