Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
I need help on this issue. I've spent hours to no avail.
I am doing a app embedded report with Javascript library following the tutorials. Everything is working except updating the layoutType setting using the report.updateSettings.
If I define the layoutType in the orginal config settings of the ebedded report, it will work, but nothing I am doing will update it dynamically once the page is loaded. I can change any other settin, for example: {filterPaneEnabled: true}, and it will work but it won't update layoutType setting.
Please help!
Code:
/** * Check if screen size is mobile. If so, change report to mobile view. */ function checkWidth() { var newSettings = null; var windowsize = $(window).width(); if (windowsize < 768) { console.log("Mobile! window size is: " + windowsize); newSettings = { layoutType: models.LayoutType.MobilePortrait }; } else { // Get models. models contains enums that can be used. console.log("Desktop! window size is: " + windowsize); newSettings = { layoutType: models.LayoutType.Master }; } // Get a reference to the embedded report HTML element embedContainer = $('#reportContainer')[0]; // Get a reference to the embedded report. report = powerbi.get(embedContainer); // Update the settings by passing in the new settings you have configured. report.updateSettings(newSettings) .then(function () { console.log("Changed Layout to:"); console.log(newSettings); }) .catch(function (errors) { console.log(errors); }); }
Hi @esng , Switching to a mobile layout via update settings function is currently not possible. It has been listed as an limitation in the microsoft documentation Documentation Link
Thanks,
Jai
Proud to be a Super User! | |
Any solution same problem 😞
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
12 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
13 | |
13 | |
7 | |
5 | |
4 |