Forum Discussion
MobilePortrait layout renders differently in JavaScript SDK embed vs Power BI Service
I'm using the latest version of the powerbi-client SDK. I noticed that this issue happens when the PBIR model is enabled, so it seems to be a PBIR limitation.
When I try to run JavaScript to validate whether the page has a Mobile Layout, the result is not returning true.
Hi rafaelmpsantos,
Thanks for the update. Since you're already on the latest powerbi-client SDK, you can use page.hasLayout(models.LayoutType.MobilePortrait) to determine whether the page includes a Mobile Portrait layout. The documentation says this method returns a boolean that indicates whether the page has the specified layout. Microsoft also notes that if a page doesn't have a Mobile Portrait layout, it will be loaded with the MobileLandscape layout.
Embedding a Power BI report with mobile layout in Power BI embedded analytics | Microsoft Learn
Thank you.
- rafaelmpsantos2 months ago
Responsive Resident
The method page.hasLayout(models.LayoutType.MobilePortrait) does not works in PBIR reports. It's a bug.
- v-saisrao-msft2 months ago
Community Support
Hi rafaelmpsantos,
Thank you for the update. Since you've reproduced the behavior and believe this is a bug specific to PBIR reports, I'd recommend raising a Microsoft Support ticket.
Create a Fabric and Power BI Support Ticket - Power BI | Microsoft LearnThank you.