Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I am using Power BI JavaScript API's to integrate Power BI reports (deployed in service) into an ASP.Net MVC web application. I am stuck with below two issues. Could anyone please provide pointers on how to resolve them.
Printing issue:
I am using the below code to print a Power BI report,
// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];
// Get a reference to the embedded report.
report = powerbi.get(reportContainer);
// Trigger the print dialog for your browser.
report.print()
.then(function (result) {
Log.log(result);
})
.catch(function (errors) {
Log.log(errors);
});
Using above the print works well in Chrome, but does not work correctly in IE 11 (version 11.0.9600.18665). It prints the entire web page (with web application menus, logo,footer etc.) instead of the iframe which holds the Power BI report.
When I right click on the report and print, then the print is some what better i.e. it prints out only the iframe but it cuts the report from left and right by some margin. I even tried to use Landscape mode instead of the Portrait but no luck.
Incidently the site https://microsoft.github.io/PowerBI-JavaScript/demo/code-demo/index.html too does not print the report correctly it prints out the whole page.
Navigate to particular page issue:
I am using the below code to navigate to a particular page in report when a user clicks on particular menu item.
// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];
// Get a reference to the embedded report.
report = powerbi.get(reportContainer);
var menuName = "Test Page";
report.getPages()
.then(function (reportPages) {
pages = reportPages;
for (var i = 0; i < pages.length; i++) {
if(pages[i].displayName.trim() == menuName.trim())
{
pages[i].setActive();
}
}
});
However this code works well in Chrome, but in IE 11 it does not work at all. I have also tried setPage(pagename) function to achive this, but it does not work.
Thanks,
Vinayak
Was this ever resolved?
Promise is not supported by IE11 since this is pretty modern feature.
If you want to use Promise (then, catch) you should load a polyfill such as Bluebird.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Was this ever resolved?
Was this ever resolved?
@Anonymous
Thanks for reporting that. What are the output in the "Console" tab in the dev tool(F12) in IE?
Hi @Eric_Zhang,
Thank you for the reply. Please see below errors logged in console.
Printing issue:
SCRIPT5009: 'Promise' is undefined
File: powerbi.js, Line: 5557, Column: 11
Proxy(c1tbcf) did not handle message. Handlers: 3 Message: {"statusCode":202,"headers":{"id":"9bbsmd"}}.
Navigation issue:
SCRIPT5009: 'Promise' is undefined
File: powerbi.js, Line: 5557, Column: 11
SEC7120: Origin https://app.powerbi.com not found in Access-Control-Allow-Origin header.
File: reportEmbed
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
File: reportEmbed
SEC7120: Origin https://app.powerbi.com not found in Access-Control-Allow-Origin header.
File: reportEmbed
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
File: reportEmbed
SEC7120: Origin https://app.powerbi.com not found in Access-Control-Allow-Origin header.
File: reportEmbed
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
File: reportEmbed
SCRIPT438: Object doesn't support property or method 'queue'
File: localytics.min.js, Line: 15, Column: 18394
SCRIPT5009: 'Promise' is undefined
File: powerbi.js, Line: 5681, Column: 27
SCRIPT5009: 'Promise' is undefined
File: powerbi.js, Line: 5681, Column: 27
SCRIPT5009: 'Promise' is undefined
File: powerbi.js, Line: 5681, Column: 27
SEC7120: Origin https://app.powerbi.com not found in Access-Control-Allow-Origin header.
File: reportEmbed
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
File: reportEmbed
SCRIPT438: Object doesn't support property or method 'queue'
File: localytics.min.js, Line: 15, Column: 18394
SEC7120: Origin https://app.powerbi.com not found in Access-Control-Allow-Origin header.
File: reportEmbed
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
File: reportEmbed
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
11 | |
3 | |
2 | |
2 | |
2 |