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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.