Forum Discussion
report embed problem
I tried to embed reports the same way as tiles with the new api for reports list. Tiles are working perfectly but when I try to embed a report I get this error:
Uncaught SecurityError: Blocked a frame with origin "https://app.powerbi.com" from accessing a frame with origin "my domain hidden". Protocols, domains, and ports must match.
I followed this tutorial:
https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-a-power-bi-tile-or-report/
Am I doing something wrong or is it a bug?
Hi everyone,
it looks like Microsoft has taken care of this issue. I didn't change the code and it started working. It is still a little bit bugy for some types of visuals. But it renders now. The errors and warnings I get for some of the reports now:
17 Replies
- JasonDunbar
Advocate II
Hi Silko,
pmathew2000 - FYI too.
Having created API Embed samples already, I decided I'd integrate the ability to Embed a Report too. At first, I got to the same point as you, with the same cross origin javascript error.
[Edit] adding screenshot:
So, I decided I'd create a new Azure Web App and publish the Microsoft sample to see what we're doing wrong. The steps I took:
- I cloned the Github repository - https://github.com/Microsoft/PowerBI-CSharp
- I made a new Azure Web App and set up the necessary Client ID, Client Secret and granted the relevant privileges to the App.
- I made the necessary changes to Response Uri in the Solution (https://github.com/Microsoft/PowerBI-CSharp/tree/master/samples/webforms/embed-a-report-into-an-app) and then hit publish from Visual Studio to publish to my Azure Web App.
Note: I did not modify any code in the solution that I cloned, other than to replace URIs and Settings
The result? Exactly the same.
It's not immediately obvious whether we're missing something or if it is indeed an issue. I'm raising this as an issue with Microsoft in the hope that we can find out and embed some reports soon :-)
- pmathew2000Frequent Visitor
Thanks,
I was able to get the report by running the solution from Visual Studio 2013 from my local machine. So it seems some permission issues.
- Silko
Helper II
JasonDunbar thank you for taking your time with this. I hope we will soon find out anything about this issue. It would be great to embed reports as soon as possible :)
- wabreza
Microsoft Employee
Hey All,
I went through the sample app from https://github.com/Microsoft/PowerBI-CSharp and was able to successfully get a Power BI report to render.
One potential snag you may see will be making sure the Client ID you are using matches the url of your application against the registered apps redirect url.
We have recently released a new app registration tool which should make this process super simple. You can now register a new Power BI apps @ https://dev.powerbi.com/apps
- pmathew2000Frequent Visitor
Try using the sample at https://github.com/Microsoft/PowerBI-CSharp ( folder embed-a-report-into-an-app under samples/webforms)
- hxy0135New Member
HI,
I downloaded the sample,I registered my app and got back clientId and clientSecret. The when I run the code and clicked the button "GetReport", I got the empty response back. the following is the responseContent. I'd like to know why. Please help
{
"@odata.context":"http://api.powerbi.com/beta/myorg/$metadata#reports","value":[
]
}
- brenkehoe
Helper I
I have it the other way around wherby i can embed reports fine but when i try the loadTile function i get a javasccript error after posting the auth details to the iframe. The error occurs because it is trying to parse undefined. The reports work in the same page but not the tiles any ideas ?
Also i notice that standard users can view embedded reports with pro content is this by design ?
- AnonymousNot applicable
Power BI Supports for embed power BI dashboard on your website via IFrame.
Embed the powerBi report in html iFrame