Embedding paginated report in Power BI Embedded Gen 2 - web application - powerbi

I have a power bi paginated report which is published in the workspace, powered by a A2 SKU (power BI embedded gen2) so the paginated report workload is already enabled against the capacity and workspace.
Now I have 3 questions:
question 1 : to test this paginated report in our web application, what's the progress? I read MS documentation but couldn't figure it out. we already do have normal pbix REPORT configured in the web application and they are all showing up. however, for paginated report I guess I need to somehow add some controller to it? below please see the part we have for standard users:
<section id="report-container" class="section__content"
power-bi-access-token="#Model.Report.FirstOrDefault().AccessToken.Token"
power-bi-id="#Model.Report.FirstOrDefault().Report.Id"
power-bi-embed-url="#Model.Report.FirstOrDefault().Report.EmbedUrl"
power-bi-embed-pages="#Model.Report.FirstOrDefault().Pages">
</section>
question 2: if above solution (to view embedded paginated report in the web application) takes a long time to develop, then what other ways do I have to test if embedding paginated report works in our A2 capacity as an external users (I need to test it using access token)
question 3: based on this link in Microsoft documentation , do you have any sample code so that I use to generate mine?

1: This is the embedding configuration for Paginated Report, you can read about each of the properties here.
let embedConfiguration = {
accessToken: anAccessToken,
embedUrl: anEmbedUrl,
uniqueId: aReportId,
tokenType: aTokenType,
type: 'report'
};
2: For embedding a paginated report, an EM or P SKU is required.
3: You can explore the Playground to understand the various embedding features:
Power BI Playground - Explore our APIs
There are some sample codes in this git directory you can use: GitHub - microsoft/PowerBI-Developer-Samples: A collection of Power BI samples for developer use.
References:
Embed a paginated report in Power BI embedded analytics | Microsoft Docs
Embed paginated reports in your Power BI embedded analytics application - Power BI | Microsoft Docs
Power BI Playground - Explore our APIs
powerbi-docs/embed-paginated-reports-customers.md at live · MicrosoftDocs/powerbi-docs · GitHub

Related

What license can embed a Power BI report to a public web (html file)

Hi I am using a free license of Power BI account to build report. If I want to embed the Power BI report to my company's html page, should I have to own a Pro license to do that?
Basically I am asking after my couple of days of free trial license, can I still have the function to do so?
Thanks
With the free version you can use 'Publish to Web', but reports have to be in 'My Workspace' you'll not be able to share items to web from other workspaces, that will require a Pro license. If the option is turned off in the Power BI tenant, (it is turned off by default) by your Power BI Admin, then you will not be able to publish items at all.
More details on the MS Doc website here: https://learn.microsoft.com/en-us/power-bi/consumer/end-user-features
Please note, publish to web should only be used for data that can be consumed by anyone freely as it is not secure. You haven't mentioned what type of report it is, or the data it will contain in your company's html page. If it contains company confidential data, do not use 'publish to web' as anyone with the url can access the report.
If for example, it shows freely available data, then it is safe to use. Some local authorities use 'Publish to Web' to show data such as bin collection, service KPI's, covid rates, and pollution levels in the city center, all publicly accessible data, presented in a visual manner.
If the data cannot be shared publicly, then your other option is to only share with other Pro users to allow show the page in your website, it will then prompt the user to login Power BI.

Power BI - generating embed code for a dashboard instead of a report

I can't figure out how to generate an embed code for a Power BI Dashboard - see picture of dashboard below. There is a "more options" on the dashboard, but no actual way to get an embed code in order to embed on a public website. I have this in report form (it's just the map, so only a one-page report) and I can generate an embed code for the report.
If I click on the dashboard itself, it just takes me back to the report, and any embed code I generate there just embeds the report, which annoyingly is not centered and includes the Power BI menu at the bottom:
Am I missing something here? Where is the option to get an embed code for a dashboard?
The Publish to Web option in Power BI is for reports only, not for dashboards or Apps. Any other embedding for a publicly accessible object must use the custom app approach, with the relevant Premium or Embedded Service.

Filters (Parameters) for RDL (Paginated) report in PowerBI-JavaScript API

Looks like filters (parameters) are not applied and not fetched for Paginated Reports similar to Sample Reports as shown in demo (https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html#)
report.setFilters([filter]);
report.getFilters();
Is there any way to fetch filters and apply them for embedded Paginated reports?
Power BI embedded JS SDK doesn't support get / set filters on Paginated reports.
In Power BI Embedded Playgroud:
go to Sample Tool -> Sample Paginated Report -> hit "Run" on the code section to embed a sample paginated report -> navigate to "Interact" tab to see all the supported APIs for paginated reports

PowerBI publish to web add parameter

I have a Power BI report that I want to integrate with my outward facing website.
On my website, if the user clicks on the name "Frank" I would like to pass this paramter to my BI Report. Internally this works with
Query00/name eq 'Frank' appended to the report's URL.
However, when I publish this report to the WEB (Public not within the organization) this parameter string does not work. How do I pass a parameter to a published BI report?
As you can see from the official documentation, this isn't supported:
Query string filtering doesn't work with Publish to web or Export to PDF.
You can either add slicers to your report, which will allow your visitors to filter the data, or embed it in another way.
Secure embedding supports URL filters, but the proper way to do this is to actually embed the report into your site. You can see it in action in Power BI Embedded Playground. When embedding, there are two scenarios - "user owns data", in which each visitor needs Power BI Pro account to see the report, and "app owns data", in which your application uses one Power BI Pro account to authenticate itself, but your users don't need to have Power BI accounts at all. In your case you need the later one.
Simply download Microsoft's sample application and configure it. You need to register Azure AD application to be used in your app. Then your app will authenticate itself and use Power BI REST API to get report's embedUrl and use it with Power BI JavaScript client to embed it in an empty <div> in a web page.
How to embed Power BI is a common question here on StackOverflow, so you can also read other answers, like:
Is there any way to embed power bi reports and dashboards in vb.net or C# desktop application with sql server 2008 database?
How to set filters in reports power BI embedded javascript
How to integrate Power BI in a Delphi desktop application
INTEGRATION OF POWER BI WITH HTML PAGE AND ESTABLISHING COMMUNICATION BTW HTML PAGE AND POWER BI
In this example we will embed the powerbi content in html page and create button in html page through which the view of the page will change. the below example i have modified as per above question
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button class="textLarge" onclick='show("ReportSection", "Frank");' style="display: inline-block;">Frank</button>
So here I am using a button click function "show" which has two parameters one is "page name" and other is "filtervalue"
and I have a iframe through which I am embedding my power bi report.
just remember that the filter value and you are putting is similar to the one in the published Bi report. Avoid spelling mistake as there would be character matching on the string.
<iframe id="embeddedframe" width="2000" height="1000" src="https://app.powerbi.com/reportEmbed?reportId=(put_your_report_id_here_and remove_parenthesis)&groupId=(put_your_group_id_here_and remove_parenthesis)&autoAuth=true&ctid=(put_your_ct_id_here_and remove_parenthesis)&pageName=" frameborder="0" allowFullScreen="true"></iframe>
Basically you don't have to edit the iframe URL, you can directly get it from bi service portal
Then call the below function
In below function you need to edit the
1) baseURL
2) Table_Nameand Colum_Name
3)iframe_id
<script>
function show(pageName, filterValue)
{
var baseUrl='https://app.powerbi.com/reportEmbed?
reportId=b0f&groupId=e2c&autoAuth=true&ctid=efc8&config=e&pageName='
var newUrl = baseUrl + "&pageName=" + pageName;
if(null != filterValue && "" != filterValue)
{
newUrl += "&$filter=Table_Name/Column_name eq '" + filterValue + "'";
}
//Assumes there's an iFrame on the page with id="iFrame"
var report = document.getElementById("embeddedframe")
report.src = newUrl;
}
</script>

Dynamic parameter insertion to filter data in iframed dashboard from with in webapp

We have a web applicaiton used by over 1000 customers.
We would like the abilitu to assist over customers to analyse their account level information i.e. Spend analysis, account overview, product overview.
What we are looking to find a way of passing a customer ID to a query datasaet that pulls customer specific information from the database and binds it to the published iframed power bi dashboard on the go.
Thanks in advance
I would suggest to design a generic report on Power BI desktop using the Customer ID as a report level filter. Then, when you embed the report in your web app, you can set the filter to each customer's ID by passing it as a parameter on the embed report URL:
https://app.powerbi.com/reportEmbed
?reportId=d2a0ea38-...-9673-ee9655d54a4a&
$filter={tableName/fieldName}%20eq%20'{fieldValue}'
(from Power BI embedded documentation)
If you need more ability to interact with your report I'd recommend the documentation on the JavaScript API for Power BI Embedded.