web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to remove the bord...
Power Pages
Unanswered

How to remove the border of an embedded power bi report

(0) ShareShare
ReportReport
Posted on by 179

Hi All

 

We have a portal page that contains an embedded power bi report (using the power bi component). When the report is displayed there is a border on the left and top of the report. How can this be removed?

 

I've looked at this further. In the browser using the developer tool (f12) I can see the iframe which contains the report. I can edit the iframe tag and manipulate the border. So I've tried using javascript (in the advanced section of the page in portal management) to do the same but no joy. I'm using getElementsByTagName but it doesn't see the iframe. Is this to do with how the page is being built, is there an event that needs to fire before I can access the iframe element?

 

Thanks

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @paulsnolan 

     

      There is a recent article from @OOlashyn to customize Power BI embedded frame. Link for your reference 

     

    https://www.dancingwithcrm.com/customizing-embedded-powerbi-in-powerapps-portal/ 

     

    This should solve your problem. If you have no joy please let us know. 

     

    Hope it helps. 

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • paulsnolan Profile Picture
    179 on at

    Hi ragavanrajan

     

    Thanks for the reply. That worked, almost. I've got working code and I've placed it in the Custom Javascript section of the Advanced tab of the Web Page which has the power bi-component. I say it almost works because sometimes it works and sometimes it doesn't. I've put alerts in the code and some at the start and end of the code. From this, I can see when the Custome Javascript is being executed. When the code doesn't work it is when the Custom Javascript isn't being executed like there is some caching of the page somewhere. From my alerts, I can see when the events are being fired and that is when the code works i.e. it is executed. Any ideas?

     

    Bit more information. I’m styling the Iframe. Is there another way using report.updateSettings?

  • paulsnolan Profile Picture
    179 on at

    Hi ragavanrajan

     

    This is my Custom Javascript code.

     

    alert("In Advanced> Custom Javascript");

     

    $(window).load(function() {

        // get div container for powerbi report

        var embedContainer = $(".powerbi")[0];

     

        // get reference to the embedded report

        var report = powerbi.get(embedContainer);

     

        // register a function to execute when report will finish loading

        report.on("loaded", function(){

            // update existing setting of the reports

            // you can disable only one page or both at the same time

            report.updateSettings({

                panes: {

                    filters :{

                        visible: false

                    },

                }

            }).catch(function (errors) {

                console.log(errors);

            });

     

            styleIframe()

     

        })

    });

     

    function styleIframe() {

     

      var embedContainer = $(".powerbi")[0];

      var report = powerbi.get(embedContainer);

     

      /*alert("Report loading ...");*/

     

      report.on("rendered", function() {

       

        /*alert("Report loaded so try and manipulate the embedded report");*/

     

        var iframeElements = document.getElementsByTagName("iframe");

        iframeElements[0].style.borderColor = "#f4f4f5";

        iframeElements[0].style.borderStyle = "solid";

        iframeElements[0].style.borderRadius = "10px";

        iframeElements[0].style.borderWidth = "10px";

     

      });

    }

     

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @paulsnolan , 

     

            Apologize for the delay in response. I completely missed it.  If you are after only changing the iFrame border. then below is the solution. 

     

    In portal studio: 

     

    1. Themes > Upload "Custom.css" file 

    2. And paste in the below css 

     

    iframe {
     border-width: 10px !important;
     border-style: inset !important;
     border-color: #f4f4f5 !important;
     border-image: initial;
    }

    3. Press the sync configuration and browse the website. 

     

    Note: !Important is a must.  

    Note 1: Change the CSS according to your need. 

     

    Output: 

     

    ragavanrajan_0-1620185466806.png


    Hope it helps. 

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 51

#2
rezarizvii Profile Picture

rezarizvii 35

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 29 Most Valuable Professional

Last 30 days Overall leaderboard