Powerbi “如何隐藏”;第页“;及;“过滤器”;使用iFrame嵌入Power BI报告时

Powerbi “如何隐藏”;第页“;及;“过滤器”;使用iFrame嵌入Power BI报告时,powerbi,powerbi-embedded,powerbi-filters,Powerbi,Powerbi Embedded,Powerbi Filters,我正试图使用iframe将Power BI报告嵌入到我的网页中,但它会显示网页名称和网页中报告的右侧筛选器,我们可以从报告中隐藏网页名称和筛选器吗?您可以配置报告的设置。将下面的标志设置为false,以实现设置中所需的功能 settings: { filterPaneEnabled: false, navContentPaneEnabled: false } 您可以在这里阅读: 如另一个答案所述,如果您使用的是PowerBI JavaScript API,您可以尝试传入这些参数: 文件

我正试图使用iframe将Power BI报告嵌入到我的网页中,但它会显示网页名称和网页中报告的右侧筛选器,我们可以从报告中隐藏网页名称和筛选器吗?

您可以配置报告的设置。将下面的标志设置为false,以实现设置中所需的功能

settings: {
  filterPaneEnabled: false,
  navContentPaneEnabled: false
}
您可以在这里阅读:

如另一个答案所述,如果您使用的是PowerBI JavaScript API,您可以尝试传入这些参数

文件:

否则,您可以尝试操纵正在使用的iframe的DOM,如下所示:

<!DOCTYPE html>
<html>

<body>

    <iframe id="myframe" src="demo_iframe.htm"></iframe>

    <p>Click the button to change the background color of the document contained in the iframe.</p>

    <p id="demo"></p>

    <button onclick="myFunction()">Try it</button>

    <script>
        function myFunction() {
            var x = document.getElementById("myframe");
            var y = (x.contentWindow || x.contentDocument);
            if (y.document) y = y.document;
            y.body.style.backgroundColor = "red";
        }
    </script>

</body>

</html>

单击该按钮可更改iframe中包含的文档的背景色

试试看 函数myFunction(){ var x=document.getElementById(“myframe”); 变量y=(x.contentWindow | | x.contentDocument); 如果(y.文件)y=y.文件; y、 body.style.backgroundColor=“红色”; }
您可以在此处看到演示:

这里有一个关于它是如何工作的解释:

<!DOCTYPE html>
<html>

<body>

    <iframe id="myframe" src="demo_iframe.htm"></iframe>

    <p>Click the button to change the background color of the document contained in the iframe.</p>

    <p id="demo"></p>

    <button onclick="myFunction()">Try it</button>

    <script>
        function myFunction() {
            var x = document.getElementById("myframe");
            var y = (x.contentWindow || x.contentDocument);
            if (y.document) y = y.document;
            y.body.style.backgroundColor = "red";
        }
    </script>

</body>

</html>