cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Mobile view is not being shown for embedded powerbi report

We have created a PowerBI report having both the desktop verion and mobile virson.

Its showing desktop and pone view properly when we are testing at following sample site after putting correct information. 

https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html

 

But when we open the website on mobile It is still showing the desktop version of the report.

File version used of powerbi.js file is 'powerbi-client v2.5.1'.

The HTML and javascript used is provided below

We are also appending '&isMobile=true' with embed report url.

Are we missing any reference to show the mobile version.

 

 <div id="reportContainer" style="width: 100%; height: 610px" 
aria-atomic="True" aria-multiline="True"
aria-multiselectable="True" aria-orientation="vertical"> </div>
<script src="~/Scripts/powerbi.js"></script> <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script> $(document).ready(function() { var txtAccessToken = "@Model.EmbedToken.Token"; var txtEmbedUrl = "@Html.Raw(Model.EmbedUrl)"; var txtEmbedReportId = "@Model.Id"; var tokenType = $('input:radio[name=tokenType]:checked').val(); var models = window['powerbi-client'].models; var permissions = models.Permissions.All; var config = {
type
: 'report',
tokenType
: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
accessToken
: txtAccessToken,
embedUrl
: txtEmbedUrl,
id
: txtEmbedReportId,
permissions
: permissions,
settings
: {
layoutType
: models.LayoutType.MobilePortrait } }; // Get a reference to the embedded report HTML element var embedContainer = $('#reportContainer')[0]; var report = powerbi.embed(embedContainer, config);
report
.off("loaded"); // Report.on will add an event handler which prints to Log window.
report
.on("loaded", function() { Log.logText("Loaded"); }); report.on("error", function(event) { Log.log(event.detail); report.off("error"); }); report.off("saved"); report.on("saved", function(event) { Log.log(event.detail); if (event.detail.saveAs) { Log.logText('In order to interact with the new report,
create a new token and load the new report'
); } }); }); </script>
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Regular Visitor

Re: Mobile view is not being shown for embedded powerbi report

Thanks for the reply. 

 

Issue is resolved. I was appending isMobile=true in embededUrl property of configuration.

report.EmbedUrl = report.EmbedUrl + "&isMobile=true";

We need not to append "&isMobile=true" explicitly, this parameter will be updated in the iframe url automatically.

 

Thanks again for the help.

View solution in original post

5 REPLIES 5
Highlighted
Microsoft
Microsoft

Re: Mobile view is not being shown for embedded powerbi report

Hi @gurpreet,

 

The trick here is that every page needs a mobile view first. How to create a mobile view. Please refer to desktop-create-phone-report. The snapshot shows my test. We can see the difference clearly.

Mobile_view_is_not_being_shown_for_embedded_powerbi_report

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor

Re: Mobile view is not being shown for embedded powerbi report

Thanks for the reply. 

 

Issue is resolved. I was appending isMobile=true in embededUrl property of configuration.

report.EmbedUrl = report.EmbedUrl + "&isMobile=true";

We need not to append "&isMobile=true" explicitly, this parameter will be updated in the iframe url automatically.

 

Thanks again for the help.

View solution in original post

Highlighted
New Member

Re: Mobile view is not being shown for embedded powerbi report

Hello everyone,
Hello @gurpreet ,
Hello @v-jiascu-msft ,
I am just trying to "Publish to web (public)" a Power BI report which has both a Desktop and a Mobile view by using a Power BI Pro account.  I can easily access the report via Desktop. However, whatever I have tried out of the solutions discussed here it does not support phone (mobile) view via web, i.e. when I access the report via smart phone it will only show the Desktop version.
Is there any other (new) solition to this? Or is this just not supported?
Thanks in advance!

Highlighted
Frequent Visitor

Re: Mobile view is not being shown for embedded powerbi report

Please could you clarify as i am facing same issue

 

I need details steps

Highlighted
Regular Visitor

Re: Mobile view is not being shown for embedded powerbi report

Do you mean that you have mention an attribute called IsMobile in the Config section instead of concatenate the Embeded URL?

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!