Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago

setting background color of the iframe

We are embeding a pbi report in our app using the javascript api.  The issue is the background color of the iframe / div exploreCanvas is a grey [#EAEAEA].  For seamless integration in our app i'd like to remove the background color or set it to white.  Any ideas?

4 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Icon for Microsoft Employee rankMicrosoft Employee

    Anonymous wrote:

    We are embeding a pbi report in our app using the javascript api.  The issue is the background color of the iframe / div exploreCanvas is a grey [#EAEAEA].  For seamless integration in our app i'd like to remove the background color or set it to white.  Any ideas?


    Anonymous

    I used to read some blog and did some research on changing the background of an iframe. The conclusion is that, iframe is a container, you can change the container background color but not the the background color of the html page in the container, which means no for your request, you can't change the background color of the power bi page in the iframe.

     

    There seems some Javascript tricks that can manipulate the page CSS stype in the iframe only if the page is from the same domain of the main page containing iframe. However Power BI report pages are surely not from the same domain of your web application.

  • Use the Wallpaper setting section in the Format Pane and set the wallpaper color to black or #000000 or the color you wish. That would be the color of the iframe.