Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Embedding multiple reports in the MVC Example Code

Hi everyone,

 

I'm going round in circles while trying to embed multiple reports into a Power BI Embedded solution, I hope someone can help. 

 

I've downloaded the example "App Owns Data" Visual Studio MVC application and have managed to get it working with the "default" first dashboard or report in a group but now I'd like to be able to control which report is displayed.  It looks like I need to control the value of the "reportId" within the HomeController.cs code file and I can manually manipulate this value by simple assigning it a hard-coded value, I can then embed any report in the group.

 

My issue comes from how to actually pass a reportid into the HomeController.cs file so I can control which report is actually displayed.  Has anyone been able to do this?

 

Thanks

4 REPLIES 4
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Anonymous wrote:

Hi everyone,

 

I'm going round in circles while trying to embed multiple reports into a Power BI Embedded solution, I hope someone can help. 

 

I've downloaded the example "App Owns Data" Visual Studio MVC application and have managed to get it working with the "default" first dashboard or report in a group but now I'd like to be able to control which report is displayed.  It looks like I need to control the value of the "reportId" within the HomeController.cs code file and I can manually manipulate this value by simple assigning it a hard-coded value, I can then embed any report in the group.

 

My issue comes from how to actually pass a reportid into the HomeController.cs file so I can control which report is actually displayed.  Has anyone been able to do this?

 

Thanks


@Anonymous

I don't quite get your issue. If you'd like to embed one fixed report, you can hard code the reportid. In other case, you can get the reportids and embed reports according to your bussiness logic. You'll find all reports in one workspace via

var reports = await client.Reports.GetReportsInGroupAsync(GroupId);

 

Anonymous
Not applicable

Hi, so if I get the reportids can i then loop through and embed them on a web page?


@Anonymous wrote:

Hi, so if I get the reportids can i then loop through and embed them on a web page?


You can surely do that. The reports just have to be in different iframes.

Juramirez
Resolver I
Resolver I

Hi @Anonymous

 

I solved it creating multiple App Workspace and make the call to them dynamic. In each App Workspace is a report an it is displaying depending an id that I send through my app. Hope it helps you

 

Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.