Embedding Power BI Reports with Power BI Report Server

A common question I get is what will we will be able to do around embedding Power BI reports with Power BI report server. To understand this it is important to look at how the Power BI reports are being integrated into SSRS.

The Power BI reports are really a new type of reports supported by Reporting services. In SQL Server 2016 we added support for mobile reports and now with Power BI Report Server we add support for Power BI reports. This means that the reports will be using the traditional reporting services framework and “content management” system which means it’s existing folder structure including all it’s security features but also it’s existing embedding framework. Now SSRS has several ways to do embedding, one is using the reportviewer control and the other is through iframe embedding. The report viewer control only works for RDL files, not for the mobile reports nor for the Power BI reports, that leaves us with the traditional IFrame embedding.  Let’s take a look at this works.

To try this I started by creating a sample report and upload it to Power BI report server:


This I can open and see as part of my Report Server:


Now let’s say I want to embed this into a regular ASP.NET application. I start by creating a blank ASP.NET web app in Visual Studio and remove all the content from my Default.ASPX  within the asp:Content tags and replace it with an asp.net Iframe, leaving my page to look like this:

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<IFRAME id="frame1" scrolling="auto" runat="server" width="1000px;" height="600px">

Now in my code behind I want to load my report:

protected void Page_Load(object sender, EventArgs e)
frame1.Src = "http://kadejosb/Reports/powerbi/PBItest/pbitest";

Running this will compile and run but will not show anything:


The trick here is to add the following parameter to the URL: “?rs:Embed=true” as described here in the SSRS team blog. This will generate an embedding-optimized view of the report.

Now the code looks like this:

protected void Page_Load(object sender, EventArgs e)
frame1.Src = "http://kadejosb/Reports/powerbi/PBItest/pbitest?rs:Embed=true";

Now running this again give us what we want:


And that is it, of course this can be used in a customer application or when you want to embed into SharePoint.

A few interesting things to note here are:

  1. There are currently no ways to add parameters to the connection string, I talked to the team and this is definitely on the road map.
  2. The user who is connecting to your custom app also needs to have access to the Power BI report on the report server, this is great for internal applications but harder for extranet scenario’s. A solution to this is also on the road map.
  • Artie Roggeband

    Thanks for working out this code. Even for internal apps, what is the “security” tolerance to using an iFrame still these days?

    • Kasper

      not sure what the problem with IFrames are in this case compared to anything else? There are no “public” client side parameters that flow that could be intercepted. I don’t see the attack vector.

  • Pingback: # Excel Super Links #62 – shared by David Hager | Excel For You()

  • Dhawal Mehta

    Hi Kasper,

    Did you tried this with OnPrem SharePoint, cause if i am using Content Editor WebPart it does not working and just showing “Loading Data…” and not the report

    • Kasper

      I did not try that, if it is just an Iframe it should work.

    • Dmitry Ponkratenko

      getting into the same issue.
      is there any workaround?

  • John Bailey

    How far down the road on the road map is embedding Power BI reports for extranet scenarios?

  • akarsh vijay

    Embedding reports from Power BI server into applications displaying role level access data will be great, is there a timeline on when this would be available.