Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
We are currently utilizing the ASP.NET application framework version 4.8. We are preparing to transfer our database from an on-premises SQL Server to Azure SQL. As part of this process, we intend to migrate the exisitng SSRS RDL files from SQL Server Reporting Services to the Power BI service as paginated reports.
Currently, we are developing a proof of concept for embedding Power BI within our ASP.NET application.
1. Could you please provide comprehensive instructions on how to embed Power BI in an ASP.NET framework application, including code examples to support us?
2. Additionally, if possible, could you recommend how to pass parameters to Power BI report service reports through the application level for each report?
Solved! Go to Solution.
1. Embedding a paginated report in a .NET application is no different than embedding a regular Power BI report. Please read through the various sections of this Microsoft Learn series on Power BI Embedded Analytics -
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-paginated-reports?tabs=customers
As well as -
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-organization-app
If you haven't already moved your old SSRS reports to Power BI service, I'd recommend doing that as the first step so you can familiarize yourself with that part beforehand as that's where you will get the embed codes.
If you want in-depth help step by step, I'd recommend getting in touch with Microsoft support.
2. There are many ways to pass parameters to an embedded paginated report at application level, simplest one being typing in the parameter value in the embedded report itself ( if I remember correctly from an old project of ours, embedded parameterized reports won't execute without a parameter even if your .NET application page has loaded). The other way you can do that is to pass it through the REST API. What and how that looks at the front end is up to you and your developer.
Hi @Lakshmanan1
Embedding Power BI within an ASP.NET Framework 4.8 application involves integrating authentication with Azure Active Directory, retrieving Power BI report metadata using REST APIs, and displaying the report using the Power BI JavaScript SDK. To begin, you must register your ASP.NET app in Azure Active Directory via the Azure portal, specifying the redirect URI and configuring required API permissions such as Report.Read.All and Dataset.Read.All for the Power BI Service. After registration, you can use the Microsoft Authentication Library (MSAL.NET) to authenticate and acquire an access token programmatically in your backend code. This token is used to call Power BI REST APIs to fetch the embed URL and generate an embed token for a specific report. On the front end, you utilize the Power BI JavaScript SDK to load the report into a specified HTML container using the retrieved embed URL and token. The JavaScript configuration includes various options like toggling the filter pane or navigation pane, allowing for a more tailored report experience within your application.
When it comes to passing parameters to Power BI reports through the application, the approach varies slightly between interactive Power BI reports and paginated (RDL) reports. For interactive reports, you can apply filters dynamically using JavaScript after the report is loaded by calling methods like setFilters and defining the desired filter conditions. This enables you to pass parameter-like values from the application context to shape the report content in real time. For paginated reports, parameters are passed directly via query strings in the embed URL using the rp: prefix followed by the parameter name and value. For example, appending &rp:Region=West to the embed URL will pass the value "West" to the "Region" parameter in the RDL report. This makes paginated report parameterization straightforward and compatible with your SSRS migration goals. By following these steps, your team can effectively embed Power BI in your ASP.NET app while ensuring a smooth transition from SSRS to the Power BI Service for both interactive and paginated reporting.
Hi @Lakshmanan1
Embedding Power BI within an ASP.NET Framework 4.8 application involves integrating authentication with Azure Active Directory, retrieving Power BI report metadata using REST APIs, and displaying the report using the Power BI JavaScript SDK. To begin, you must register your ASP.NET app in Azure Active Directory via the Azure portal, specifying the redirect URI and configuring required API permissions such as Report.Read.All and Dataset.Read.All for the Power BI Service. After registration, you can use the Microsoft Authentication Library (MSAL.NET) to authenticate and acquire an access token programmatically in your backend code. This token is used to call Power BI REST APIs to fetch the embed URL and generate an embed token for a specific report. On the front end, you utilize the Power BI JavaScript SDK to load the report into a specified HTML container using the retrieved embed URL and token. The JavaScript configuration includes various options like toggling the filter pane or navigation pane, allowing for a more tailored report experience within your application.
When it comes to passing parameters to Power BI reports through the application, the approach varies slightly between interactive Power BI reports and paginated (RDL) reports. For interactive reports, you can apply filters dynamically using JavaScript after the report is loaded by calling methods like setFilters and defining the desired filter conditions. This enables you to pass parameter-like values from the application context to shape the report content in real time. For paginated reports, parameters are passed directly via query strings in the embed URL using the rp: prefix followed by the parameter name and value. For example, appending &rp:Region=West to the embed URL will pass the value "West" to the "Region" parameter in the RDL report. This makes paginated report parameterization straightforward and compatible with your SSRS migration goals. By following these steps, your team can effectively embed Power BI in your ASP.NET app while ensuring a smooth transition from SSRS to the Power BI Service for both interactive and paginated reporting.
Thank you, this solution works
1. Embedding a paginated report in a .NET application is no different than embedding a regular Power BI report. Please read through the various sections of this Microsoft Learn series on Power BI Embedded Analytics -
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-paginated-reports?tabs=customers
As well as -
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-organization-app
If you haven't already moved your old SSRS reports to Power BI service, I'd recommend doing that as the first step so you can familiarize yourself with that part beforehand as that's where you will get the embed codes.
If you want in-depth help step by step, I'd recommend getting in touch with Microsoft support.
2. There are many ways to pass parameters to an embedded paginated report at application level, simplest one being typing in the parameter value in the embedded report itself ( if I remember correctly from an old project of ours, embedded parameterized reports won't execute without a parameter even if your .NET application page has loaded). The other way you can do that is to pass it through the REST API. What and how that looks at the front end is up to you and your developer.
Hi @Lakshmanan1,
Thank you @pborah, for your response regarding the issue .
Just wanted to check if you had the opportunity to review the suggestion provided?
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You.
Harshitha.
Community Support Team.
Hi @Lakshmanan1,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.
Thank You.
Harshitha.
Community Support Team.
Hi @Lakshmanan1,
May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank You.
Harshitha.
Community Support Team.
User | Count |
---|---|
48 | |
31 | |
27 | |
27 | |
26 |
User | Count |
---|---|
61 | |
56 | |
35 | |
31 | |
28 |