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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jrichview
Helper I
Helper I

New failure changing pages in a web-hosted report

Our client's web page hosts a power BI report (from service) in an iframe.  There's a dropdown on the page that posts a message to the iframe window to change pages.  This has been working fine until just recently. Now it has absolutely no effect on the displayed page.  Possibly broken in recent update?

1 ACCEPTED SOLUTION
jrichview
Helper I
Helper I

Thank you, but we have the problem addressed now.  This issue can be closed.

 

For anyone still wanting to understand the issue, our original dropdown had a list of the tabs in the report and selecting an item in the dropdown would post a message (to the window inside the iframe to tell it what tab to display.  That is what broke in the update. The following is a snippet from the javascript code:

 

    var message = {
      action: 'setPage',
      pageName: PBIReports.Selector.value
    };

    PBIReports.Frame.contentWindow.postMessage(message, '*');

 

Now the code simply changes the iFrame's src attribute to the base URL with the (poorly documented) querystring parameter &pageName appended to it.

View solution in original post

5 REPLIES 5
v-qiuyu-msft
Community Support
Community Support

Hi @jrichview,

 

Thank your for sharing the solution which will benefit other members who has the same issue. 

 

I will close this thread as you requested. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jrichview
Helper I
Helper I

Thank you, but we have the problem addressed now.  This issue can be closed.

 

For anyone still wanting to understand the issue, our original dropdown had a list of the tabs in the report and selecting an item in the dropdown would post a message (to the window inside the iframe to tell it what tab to display.  That is what broke in the update. The following is a snippet from the javascript code:

 

    var message = {
      action: 'setPage',
      pageName: PBIReports.Selector.value
    };

    PBIReports.Frame.contentWindow.postMessage(message, '*');

 

Now the code simply changes the iFrame's src attribute to the base URL with the (poorly documented) querystring parameter &pageName appended to it.

v-qiuyu-msft
Community Support
Community Support

Hi @jrichview,

 

Would you please share code about how you "created a dropdown to change pages"?

 

It would be better if you could share .html file for us to reproduce the issue. If it's possible, you can upload .html file to your OneDrive and send the share link to me via private message. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jrichview
Helper I
Helper I

Yes, we use the embed code but we hide the built in pager as the client did not care for it. We created a dropdown to change pages, and that is what does not work.

 

However, since posting this I have discovered a workaround: a query string parameter to append to the url which specifies the page you want to see.

v-qiuyu-msft
Community Support
Community Support

Hi @jrichview,

 

Do you use the Embed Code generated from Publish to Web feature to embed the report in an iFrame? 

 

q3.PNG

 

If it is, please copy and paste the URL in Embed Code to a browser page to access the report, check if page name list works. 

 

q4.PNG

 

Best Regards,
Qiuyun Yu 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors