The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I'm wanting to explore mobile layout design in the PBI Embedded Playground (https://playground.powerbi.com/en-us/), but I keep getting an error when I try to change the sample report's settings to reflect the mobile layout.
First, I launch the sample report:
Then, I add the setting snippet for mobile layouts after confirming the sample report does have a mobile layout:
I'm adding the code as instructed here. This also happens with my own reports that have mobile layouts enabled.
Hi @arpost ,
Please review the following threads, hope they can help you resolve the problem.
Switch between mobile and desktop view in power bi embedded
Instead of embedding two instances of a report you can do:
Change the layout type by updating settings like here: change-layout-example. The downside of this approach is that your user's cross filters will not be saved when changing layout.
Before changing the layout type, save a bookmark and then after changing the layout type apply the saved bookmark:
function changeLayout(layoutType) { report.bookmarksManager.capture() .then(function (capturedBookmark) { var bookmarkState = capturedBookmark.state; var config = { layoutType: layoutType }; report.updateSettings(config).then(function () { report.bookmarksManager.applyState(bookmarkState); }) }) }
Please note that you will have to add error handling code to the sample above.
Use Custom layout instead of mobile layout like here: Dynamic report layout. The downside of this approach is that you will have to write code that sets the layout dynamically.
Mobile view is not being shown for embedded powerbi report
Best Regards