How to hide "Page" and "Filter" while embedding a Power BI report using an iFrame

7k views Asked by At

I am trying to embed a Power BI report in my web page using an iframe, but it shows page name and side right filter with the report in the web page, can we hide both page name and filter from the report?

3

There are 3 answers

1
Ishwar Patil On BEST ANSWER

You can configure the settings for the report. Set the below flags to false in order to achieve what you want in the settings.

settings: {
  filterPaneEnabled: false,
  navContentPaneEnabled: false
}

You can read about it here:
https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details

0
nopassport1 On

As mentioned by the other answer, you can try passing in these arguments if you are using the PowerBI JavaScript API: https://github.com/microsoft/PowerBI-JavaScript

settings: {
  filterPaneEnabled: false,
  navContentPaneEnabled: false
}

Docs: https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details

Failing that, you can try to manipulate the DOM of the iframe you're using like so:

<!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>

You can see a demo if it here:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_iframe_contentdocument

and an explanation on how this works here:
https://www.w3schools.com/jsref/prop_frame_contentdocument.asp

0
Adam Callender On

The easiest way to specify the filter and content (page) pane on the fly would be to add the &filterPaneEnabled=false and &navContentPaneEnabled=false strings to the end of your URL.