Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get rid of the grey border with the report visuals with power bi embedded?

When i render the power bi visuals, I notice that there is a grey border on the right and left side of the image. Is there a way to get rid of that? enter image description here

It's awkward that the grey border is not effecting the top or bottom of the iframe.

Thanks, Derek

like image 437
darewreck Avatar asked Mar 19 '18 07:03

darewreck


People also ask

How do I change the visual background in Power BI?

The default color is white. To change the filter pane background, you can go to the ribbon in Power BI, select 'View', click the themes dropdown, and select 'Customise Current Theme'. Then you'll be able to select ' Filter pane' and edit the background color.

How do you get rid of visuals in Power BI?

Open your report in Power BI Desktop or Power BI service. Select the ellipsis from the visualizations pane. Select Get more visuals from the menu.

How do you customize Power BI visuals?

To enable the feature in Power BI Desktop, go to File > Options and settings > Options > Current file > Report settings. Make sure Personalize visuals is turned on.


1 Answers

Try something like this. (extracted from the powerbi-javascript sample). Pass the #reportContainer div as input to powerbi.embed and you should not see the inset borders

    <style>
    #reportContainer {
        width: 100%;
        height: 750px;
        background-color: white;
        padding: 0px;
        clear: both;
    }
    .desktop-view iframe, .mobile-view iframe {
        border: none;
    }
</style>
<h2>Sample PowerBI Embedded Report</h2>
<div class="desktop-view" style="display: block;">
    <div id="reportContainer"></div>
</div>

Result

For Reports, you can do the following to make the background transparent (and also FitToWidth).

                var embedConfig = {
                    type: type,
                    id: id,
                    embedUrl: embedUrl,
                    viewMode: getViewModeFromModel(viewMode),
                    tokenType: models.TokenType.Aad,
                    accessToken: token,
                    pageView: 'fitToWidth', // applies to Dashboard only; for Report, see below
                    pageName: pageName,

                    // See https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_powerbi_models_dist_models_d_.isettings.html
                    settings: {
                        filterPaneEnabled: true,
                        navContentPaneEnabled: true,
                        background: models.BackgroundType.Transparent,
                        // START Report specific settings
                        layoutType: models.LayoutType.Custom,
                        customLayout: {
                            displayOption: models.DisplayOption.FitToWidth
                        }
                        // END Report specific settings
                    }
                }
like image 145
Sat Thiru Avatar answered Sep 28 '22 04:09

Sat Thiru