<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Embed API: Fit to Width leaving empty space in custom layout in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Embed-API-Fit-to-Width-leaving-empty-space-in-custom-layout/m-p/3597598#M46322</link>
    <description>&lt;P&gt;I am designing a custom layout for mobile users for my report using the Power BI Embed API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the puzzling issues I am encountering is the arise of blank space inside the right and bottom edges of my the iframe when using the "Fit to Width" display option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a simple test report consisting of a single blue rectangle to demonstrate my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a screenshot of the desktop report:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Power BI Debug Report.PNG" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1014828i37ABF586F81CDB24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Power BI Debug Report.PNG" alt="Power BI Debug Report.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, here is a screenshot of the embedded report using the "Fit to Width" display option:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Power BI Debug Embedded Report.PNG" style="width: 393px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1014827iAB82B8C0CBB8142D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Power BI Debug Embedded Report.PNG" alt="Power BI Debug Embedded Report.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there is extra space added between the right and bottom sides of the actual report and the edge of the iframe. Increasing/Decreasing the "pageSize" dimensions do not cover this gap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my config:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let reportLoadConfig = {
    type: "report",
    tokenType: models.TokenType.Embed,
    accessToken: embedData.accessToken,
    embedUrl: embedData.embedUrl[0].embedUrl,
    settings: {
        filterPaneEnabled: false,
        navContentPaneEnabled: false,
        layoutType: 1,  // 0 - Master, 1 - Custom, 2 - MobilePortrait, 3 - MobileLandscape
        background: models.BackgroundType.Transparent,
        customLayout: {
            pageSize: {
                type: models.PageSizeType.Custom,
                width: 400,
                height: 1400
            },
            displayOption: 1, // 1 - fit to width, 2 - Actual Size, 0 - FitToPage
            pagesLayout: {
                "ReportSection": {
                    defualtLayout: {
                        displayState: {
                            mode: 1
                        }
                    },
                    visualsLayout: {
                        "7fcbe3ebae04093b2d65": {
                            x: 0,
                            y: 0,
                            height: 1400,
                            width: 400,
                            displayState: {
                                mode: models.VisualContainerDisplayMode.Visible
                            }
                        }
                    }
                }
            }
        }
    }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dimensions of the container I am embedding in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#report-container{
    height: 700px;
    width: 400px;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set my pageSize height and the viusal height in my config to be double that of my container to represent scrolling behavior, as that is relevant to the custom layout for the mobile report I am creating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know why this happens, or if there is a way to prevent this blank space from appearing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An alternative approach I have tried is using the "actual size" display option and using additional scripting to dynamically maintain the size of my visuals. This method isn't ideal for me, as I'd like to try and minimize the amount of scripting needed when delivering to my client. Ideally, I'd like to use the "Fit to width" display option, but it's causing me issues with what I have just shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight as to how I can prevent this behavior while using the "Fit to width" display option for my custom layout would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Dec 2023 20:15:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-12-21T20:15:13Z</dc:date>
    <item>
      <title>Embed API: Fit to Width leaving empty space in custom layout</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-API-Fit-to-Width-leaving-empty-space-in-custom-layout/m-p/3597598#M46322</link>
      <description>&lt;P&gt;I am designing a custom layout for mobile users for my report using the Power BI Embed API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the puzzling issues I am encountering is the arise of blank space inside the right and bottom edges of my the iframe when using the "Fit to Width" display option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a simple test report consisting of a single blue rectangle to demonstrate my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a screenshot of the desktop report:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Power BI Debug Report.PNG" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1014828i37ABF586F81CDB24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Power BI Debug Report.PNG" alt="Power BI Debug Report.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, here is a screenshot of the embedded report using the "Fit to Width" display option:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Power BI Debug Embedded Report.PNG" style="width: 393px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1014827iAB82B8C0CBB8142D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Power BI Debug Embedded Report.PNG" alt="Power BI Debug Embedded Report.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there is extra space added between the right and bottom sides of the actual report and the edge of the iframe. Increasing/Decreasing the "pageSize" dimensions do not cover this gap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my config:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let reportLoadConfig = {
    type: "report",
    tokenType: models.TokenType.Embed,
    accessToken: embedData.accessToken,
    embedUrl: embedData.embedUrl[0].embedUrl,
    settings: {
        filterPaneEnabled: false,
        navContentPaneEnabled: false,
        layoutType: 1,  // 0 - Master, 1 - Custom, 2 - MobilePortrait, 3 - MobileLandscape
        background: models.BackgroundType.Transparent,
        customLayout: {
            pageSize: {
                type: models.PageSizeType.Custom,
                width: 400,
                height: 1400
            },
            displayOption: 1, // 1 - fit to width, 2 - Actual Size, 0 - FitToPage
            pagesLayout: {
                "ReportSection": {
                    defualtLayout: {
                        displayState: {
                            mode: 1
                        }
                    },
                    visualsLayout: {
                        "7fcbe3ebae04093b2d65": {
                            x: 0,
                            y: 0,
                            height: 1400,
                            width: 400,
                            displayState: {
                                mode: models.VisualContainerDisplayMode.Visible
                            }
                        }
                    }
                }
            }
        }
    }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dimensions of the container I am embedding in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#report-container{
    height: 700px;
    width: 400px;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set my pageSize height and the viusal height in my config to be double that of my container to represent scrolling behavior, as that is relevant to the custom layout for the mobile report I am creating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know why this happens, or if there is a way to prevent this blank space from appearing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An alternative approach I have tried is using the "actual size" display option and using additional scripting to dynamically maintain the size of my visuals. This method isn't ideal for me, as I'd like to try and minimize the amount of scripting needed when delivering to my client. Ideally, I'd like to use the "Fit to width" display option, but it's causing me issues with what I have just shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight as to how I can prevent this behavior while using the "Fit to width" display option for my custom layout would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 20:15:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-API-Fit-to-Width-leaving-empty-space-in-custom-layout/m-p/3597598#M46322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-21T20:15:13Z</dc:date>
    </item>
  </channel>
</rss>

