I have a Power BI Report that i want to Embed in ASP.net C# webform without using MVC.
Please can you help me i am a beginner in power bi
I have a Power BI Report that i want to Embed in ASP.net C# webform without using MVC.
Please can you help me i am a beginner in power bi
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek YadavPosted Feb 8, 2024, 12:20 PM
To embed a Power BI report in ASP.NET using C#, you can follow these steps:
Install the Power BI NuGet package:
In the Visual Studio Solution Explorer, right-click on your project and select "Manage NuGet Packages".
Search for "Microsoft.PowerBI.Api" and install the NuGet package.
Create a new ASP.NET web form or web page:
In the Solution Explorer, right-click on your project, select "Add" -> "New Item".
Choose either "Web Form" or "Web Page" and give it a name.
Add a reference to the Power BI API in your web form or web page:
Add the necessary HTML elements and JavaScript code to embed the Power BI report:
You can add an iframe tag in your ASP.NET page and set the source URL to the Power BI report's embed URL.
Securely embed the report by generating an embed token:
Get the access token using Azure Active Directory (Azure AD) authentication or any other authentication method of your choice.
Create an instance of a Power BI client, set the access token, and generate an embed token.
Pass the embed token to the JavaScript code that loads the embedded report:
In your ASP.NET page, add the JavaScript code that sets the access token and embeds the report using the Power BI JavaScript library.
Note: Replace the placeholders 'YOUR_REPORT_ID' and 'YOUR_GROUP_ID' with the actual values for your Power BI report and group.
This will embed the Power BI report in your ASP.NET page without using MVC.
Manikandan MurugesanPosted Feb 7, 2024, 4:34 PM
Refer the below links: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-organization-app
https://www.sqlshack.com/how-to-embed-a-power-bi-report-server-report-into-an-asp-net-web-application/
Amit MohantyPosted Feb 7, 2024, 1:12 PM
Check the below link.
https://www.sqlshack.com/how-to-embed-a-power-bi-report-server-report-into-an-asp-net-web-application/