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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
esng
New Member

report.updateSettings for layoutType not working

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);
            });



}
2 REPLIES 2
Jai-Rathinavel
Super User
Super User

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

JaiRathinavel_0-1731868571180.png

 

Thanks,

Jai




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Any solution same problem 😞

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.