Can I get rid of the grey border on the report visuals with power bi embedded

0 votes
Can I get rid of the grey border i get when i render report visuals with power bi embedded? If so, how?
Apr 10, 2019 in Power BI by Upasana
• 8,620 points
4,479 views

2 answers to this question.

0 votes

You can do the following to make the background transparent and also Fit To Width.

                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
                    }
                }
answered Apr 10, 2019 by Shubham
• 13,490 points
+1 vote
It's just a simple css code to remove border from generated iframe by powerbi. It worked perfectly for me

<style>
  iframe {  border: none; }
</style>
answered Apr 19, 2020 by Prateek Mehta
how do you do that if you're using the embed config?

Hey, @Binh,

For a transparent background, you can use the embed config:

By default, the report background is white with gray margins. If the default background does not look good into your application, use transparent background settings as follows:

let embedConfig = {
    ...
    settings: {
	background: models.BackgroundType.Transparent
    }
};

This way, You can give any style you want to the container div element, the report background will be transparent and the container div element will appear.

I hope this explanation will help you.

Thanks for the reply! I tried that and it keep through this error "Uncaught ReferenceError: models is not defined". Is "models" suppose to be an instant that I need to create, if so, what is models an instant of? Fyi, I have the embed config in a visualforce page and added the PBI Javascript library as a static resource for that page.

Related Questions In Power BI

0 votes
1 answer

Can I create a Power BI report in Office 365 without my locally installed Office Excel?

Yess!! You can achieve this by using ...READ MORE

answered Sep 26, 2018 in Power BI by Kalgi
• 52,360 points
705 views
0 votes
1 answer

Can I publish the Power BI dashboards directly to client’s website?

You can Use Publish to web feature. ...READ MORE

answered Sep 28, 2018 in Power BI by Kalgi
• 52,360 points
884 views
0 votes
1 answer

how can I connect my web api with Power BI Reports?

Go to Home > Edit Queries > ...READ MORE

answered Oct 18, 2018 in Power BI by Annie97
• 2,160 points
9,201 views
+1 vote
2 answers

403 error thrown by power bi report server when trying to get list of data sets

Hey @saranya, Try removing the header and ...READ MORE

answered Oct 29, 2018 in Power BI by Kalgi
• 52,360 points
4,070 views
0 votes
1 answer

How can i see my plugin name in the Power BI Visual plugin List ?

there is a couple of errors in your ...READ MORE

answered Nov 8, 2018 in Power BI by Upasana
• 8,620 points
1,072 views
0 votes
0 answers
0 votes
1 answer

Embed URL-multiple filters in Power BI

With the release of 2.0.0 you can ...READ MORE

answered Oct 16, 2018 in Power BI by Annie97
• 2,160 points
3,518 views
0 votes
1 answer

Passing a parameter to Power BI Embedded via embedded URL

Add the following to the end of ...READ MORE

answered Oct 23, 2018 in Power BI by Annie97
• 2,160 points
4,689 views
0 votes
1 answer

powerbi embeded in .net core 1.1

See if it helps: https://www.nuget.org/packages/PowerBI.NetStandar ...READ MORE

answered Nov 28, 2018 in Power BI by Upasana
• 8,620 points
1,209 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP