cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dcruise Frequent Visitor
Frequent Visitor

Cannot read property 'MobilePortrait' of undefined

Im trying to embed a report for mobile and using the new property 

settings: {
            layoutType: models.LayoutType.MobilePortrait
        }

found here: https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-For-Mobile

 

However, the report (which once loaded just fine) now kicks off an error:

Cannot read property 'MobilePortrait' of undefined.

 

Anyone have any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
adamwallace3 Frequent Visitor
Frequent Visitor

Re: Cannot read property 'MobilePortrait' of undefined

I first built my site to host my embedded dashboards in September of 2017. When I built the page that hosts the embedded reports themselves I cloned the PowerBi report library from GitHub and placed it the sites static file directory. To fix my problem, I cloned the most recent version of the Power Bi library and replaced the existing static files. I reloaded my static files and refreshed my server and everything works now.

6 REPLIES 6
v-micsh-msft New Contributor
New Contributor

Re: Cannot read property 'MobilePortrait' of undefined

Have you tried to update the Mobile layout setting by updateSettings function?

 

Regards,

Michael

dcruise Frequent Visitor
Frequent Visitor

Re: Cannot read property 'MobilePortrait' of undefined

Yes, I just did tonight and still the same error:

 Cannot read property 'MobilePortrait' of undefined

 

 

Code:

const newSettings = {
layoutType: models.LayoutType.MobilePortrait,
pageView: "oneColumn"

};
dashboard.updateSettings(newSettings);

 

 

 

 

 

adamwallace3 Frequent Visitor
Frequent Visitor

Re: Cannot read property 'MobilePortrait' of undefined

I'm getting the same error

 

Edit: I was able to fix my error by updating the Power Bi static files in my repo

dcruise Frequent Visitor
Frequent Visitor

Re: Cannot read property 'MobilePortrait' of undefined

Hey Adam,

 

Can you illustrate what steps you took to do this? I am very interested and im sure others are as well! 

 

Thank you! Glad you got it to work on your side!

 

 

Highlighted
adamwallace3 Frequent Visitor
Frequent Visitor

Re: Cannot read property 'MobilePortrait' of undefined

I first built my site to host my embedded dashboards in September of 2017. When I built the page that hosts the embedded reports themselves I cloned the PowerBi report library from GitHub and placed it the sites static file directory. To fix my problem, I cloned the most recent version of the Power Bi library and replaced the existing static files. I reloaded my static files and refreshed my server and everything works now.

Anonymous
Not applicable

Re: Cannot read property 'MobilePortrait' of undefined

Pro tip: when replacing the powerbi.js file be sure to wipe your cache. 

 

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 370 members 4,197 guests
Please welcome our newest community members: