Forum Discussion
Remove margins in an embedded Power BI report using iFrame on a Project Online sharepoint site
My aim is to allow Project Online users to view a Power BI report from a link in the PO menu without having to open Power BI. I want them to remain within the PO sharepoint site at all times. All users have a Power BI licence but currently only access other Power BI reports via their Teams site.
I have used the Power BI Embed report > Website or portal option to copy the html iFrame code below. A web page was created in PO and the html was pasted into a Script Editor web part.
This all worked fine, except when I view the report the font is much smaller and there are large shaded vertical margins, as you can see in the sample below. Is there any way of using html code to remove the margins and resize the report so that it takes up the whole frame?
BTW Lionel,
I removed the space - marginwidth="0" and also tried marginwidth="0px".
Thx Mark.
Thanks Lionel,
have managed to change the height and width settings in the embeded code to reduce the size of the margins. Took a few tries to get the correct size image on the screen to reduce scrolling but now have a workable page. Appreciate your help.
Regards, Mark.
5 Replies
- v-lionel-msft
Community Support
Hi markces ,
Use the element selector of the browser to analyze the HTML5 and CSS3 codes of the current page. It may be that a certain tag has fixed the left and right margins.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- markcesRegular Visitor
Thanks Lionel,
have managed to change the height and width settings in the embeded code to reduce the size of the margins. Took a few tries to get the correct size image on the screen to reduce scrolling but now have a workable page. Appreciate your help.
Regards, Mark.
- v-lionel-msft
Community Support
Hi markces ,
Try to add the "marginwidth" parameter in "iframe" label.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- markcesRegular Visitor
Thanks for the suggestion Lionel.
I have tried adding marginwidth parameter, see code below, but there is no change to the page - margins are still there.
<iframe width="1140" height="541.25" marginwidth= "0" src="https://app.powerbi.com/reportEmbed?reportId=.......... frameborder="0" allowFullScreen="true"></iframe>- markcesRegular Visitor
BTW Lionel,
I removed the space - marginwidth="0" and also tried marginwidth="0px".
Thx Mark.