Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
duggy
Advocate II
Advocate II

Iframe: Frame around the emdebbed dashboard, dashboard doesn't go to the top

Hi,

 

I have embedded a dahboard in my webpage in an iFrame. However the dashboard doesnt vertically align to the top of the iFrame. If you zoom the page down to 80% then the dashboard moves to the top of the iFrame, if it is at 100% then the dashboard moves downwards.

 

Capture.JPG

 

Here is the code for the iFrame:

 

<iframe id="idIframes" frameborder=""  src="http://mywebsite.com/mypage.aspx"></iframe> 

and here is the container in the aspx file:

 

    <script> 
        $(document).ready(function () {   
            var models = window['powerbi-client'].models;
            //debugger
            var config = {
                type: 'report',
                tokenType: models.TokenType.Embed,
                accessToken: accessToken,
                embedUrl: embedUrl,
                id: embedReportId,
                permissions: models.Permissions.All,
                settings: {
                    filterPaneEnabled: false,
                    navContentPaneEnabled: false,
                    localeSettings: {
                        language: "en-GB",
                        formatLocale: "en-GB"
                    }
                }//,
                //pageName: sectionName
            };
           
            var reportContainer = $('#reportContainer')[0];
            var report = powerbi.embed(reportContainer, config);           
        });
        

    </script>

</head>
<body style="vertical-align: top;position: relative;top: 0;">
    <form id="form1" runat="server" style="vertical-align: top;position: relative;top: 0;">
    <div style="vertical-align: top;">
        <div id="reportContainer" style="height:850px;width:100%;vertical-align: top;position: relative;top: 0;left:0;"></div>
        <asp:Label Id ="lblMessage" runat="server" />
    </div>
    </form>
1 REPLY 1
panantonioblanc
Frequent Visitor

We're having the same problem. Did you ever get or find an answer to your question?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.