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.
Hi,
I am trying to use the powerbi-client in an angular 4 application, I am getting to following error:
'getPages' does not exist on type 'Embed'.
Any help would be greatly appreciated....thanks in advance.
Here is my code:
______________________________________________________________________________
The getPages works with powerbi-client 2.4.2 in my test, what's going on if you test in below html?
<html> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script> <script src="powerbi.js"></script> <script type="text/javascript"> window.onload = function () { // Read embed application token from Model var accessToken = "embeded token"; // Read embed URL from Model var embedUrl = "embed url"; // Read dashboard Id from Model var embedReportId = "reportid"; // Get models. models contains enums that can be used. var models = window['powerbi-client'].models; var config = { type: 'report', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, id: embedReportId , settings: { filterPaneEnabled: true } }; // Get a reference to the embedded dashboard HTML element var dashboardContainer = $('#reportContainer')[0] ; // Embed the dashboard and display it within the div container. var reports = powerbi.embed(dashboardContainer, config); reports.on('loaded', function(event) { var data = event.detail; //console.log(JSON.stringify(data, null, ' ')); console.log('****************************************************'); console.log(reports.getPages()); console.log('****************************************************'); }) } </script> <div id="reportContainer"></div> </html>
Thank you for your reply,
I have implemented your suggested code but still getting nothing coming back for "reports.getPages()"...worryingly I'm not getting anything at all in the console window for the data variable even though the "filterPaneEnabled: true" is being applied.
Still getting "Property 'getPages' does not exist on type 'Embed'."
Is this because I am trying to use "powerbi-client" in an Angular 4 application?
Regards
@dpoleon wrote:
Thank you for your reply,
I have implemented your suggested code but still getting nothing coming back for "reports.getPages()"...worryingly I'm not getting anything at all in the console window for the data variable even though the "filterPaneEnabled: true" is being applied.
Still getting "Property 'getPages' does not exist on type 'Embed'."
Is this because I am trying to use "powerbi-client" in an Angular 4 application?
Regards
I don't know Angular. What's going on if you replace the token, embedurl etc in the HTML and open it in Chrome?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
2 | |
2 | |
2 | |
2 |