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
tmcdevitt
Advocate II
Advocate II

Setting the iframe background for embedded reports (default gray color is terrible)

We're embedding PowerBI reports in a custom application we're building. For the most part, this is working great. However, we can't figure out how to set the background color of the iframe in which reports are getting embedded. Note: we're not talking about the background color of the report. Instead, we're talking about the padding between the borders of the iframe and the report content. See attached image. From what we can tell, there's no way to set this from Desktop or from the embed calls we're making.

Ideally, we'd be able to reference an external CSS or something that would be used within the iframe of the report but that doesn't appear to be an option (and obviously, we can't control the styling of elements within the iframe from our application).

 

power_bi_embed_background.jpg

24 REPLIES 24
nimrod
Resolver II
Resolver II

We are working on a solution for this now, so you will be able to use it pretty soon.

In general, we will enable you to optimize the size of the report page to fit into the iframe,

without any grey padding.

In addition, you will be able to get the report size, and so you will be able to optimize the DIV size and match it with the report size. 

Ok, thanks for the info Nimrod.

 

One thing that might be really nice - allow us, in the embed call, to pass in a URL to a CSS resource that's external to PowerBI. Then, when the report renders in the iFrame, it includes that CSS. This way, we're in control of the CSS and can change up the report styling any way we choose.


@tmcdevitt wrote:

Ok, thanks for the info Nimrod.

 

One thing that might be really nice - allow us, in the embed call, to pass in a URL to a CSS resource that's external to PowerBI. Then, when the report renders in the iFrame, it includes that CSS. This way, we're in control of the CSS and can change up the report styling any way we choose.


@tmcdevitt

I guess you may have intrest in

Use Report Themes in Power BI Desktop

Power BI Themes Gallery

Hi Eric,

    We've looked at themes but they really don't get us what I'm talking about. First, they don't deal with the issue of the gray background. Second, and most important, you need to "install" them for each report and you have to do it via Desktop. So, if we've got a bunch of reports and need to roll out a theme change, guess what? We need to download each dataset, open them in Desktop, "import" the theme that changed and then publish the report. It's tedious, for sure.

    Since we're embedding reports, it would be way easier for us if we could just send you a URL to a CSS file (one that we control external to PowerBI) and then, within the embedded iframe, you guys just include the CSS file such that the styles within will be applied to the contents of the iframe.

    One other thing on themes - there doesn't appear to be a library of themes that Desktop is aware of. For example, let's say I pull down Theme A from the online theme gallery. I save that JSON file locally and then import it into a report in Desktop. Then, I want to experiment with another theme, Theme B. So, I download the JSON and import but I don't like it. So, I want to "switch" the theme in the report back to Theme A. Well, unfortunately, Desktop has no memory of Theme A. I need to go back to my local machine and import the JSON file that I had downloaded. That's fine for me but someone else who might be editing the report in another instance of Desktop won't have that JSON file on their local machine (and likely won't have any idea where to get it). Ideally, Desktop would remember all of the JSON themes that have been imported and allow you to easily switch between them without having to reupload the theme every time (Actually, now that I think about it, Desktop (and really, the online report editor) should be able to show the user the themes in the online gallery and let them install them directly from there as well).

 

- Terence

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.