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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
apenaranda
Post Patron
Post Patron

view mobile version app flask embedded

Hello,
I have an app made in Flask where I embed the power bi reports. These reports are in desktop view design and I would like to make a report in mobile view. The ideal would be to make the report in mobile and desktop view and it will detect where you are viewing it and thus show you the corresponding one.
What I don't know is to first embed the mobile view.

Would anyone know how to do it within a Flask app?

thank you.

3 REPLIES 3
apenaranda
Post Patron
Post Patron

Has anyone managed to embed a Powerbi report (previously created the mobile design view and uploaded to the Power Bi work area) in an external Powerbi application (example in python) and have the mobile design displayed? I can't believe that there is only the mobile view from the official Powerbi application.

apenaranda
Post Patron
Post Patron

I will review what you say.
In reference to the javascript code, I have already tested it on localhost from my PC, adding this part to the code but it doesn't do anything, I don't know if it detects desktop so it no longer shows the mobile layout, is that right?...
On the other hand, if the mobile design is for the power bi app, how should I do it if I have my own app in python? Basically what I want is to show the mobile or desktop design depending on which device I connect from.

 

var embedConfiguration = {
    type: 'report',
    id: reportId,
    embedUrl: embedUrl,
    tokenType: tokenType,
    accessToken: accessToken,
    settings: {
        layoutType: models.LayoutType.MobilePortrait
    }
};
v-shex-msft
Community Support
Community Support

HI @apenaranda,

You can take a look at the following link about the similar requirement:

powerbi - Embed power bi dashboard into Flask Application - Stack Overflow

It is possible dynamic switch between report layout and mobile layout. You can add JavaScript function to verify the requests(e.g. UA) to get device type, then you can dynamic switch the embed configurations layout part.

Embedding a Power BI report with mobile layout in Power BI embedded analytics | Microsoft Learn

BTW, current the mobile layout are worked for power bi mobile app, it not suitable when directly access from mobile device.

About mobile-optimized Power BI reports - Power BI | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.