Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17878

powerbi-client 2.4.2

$
0
0

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:

______________________________________________________________________________

 

ngOnInit() {
this.reportId='dca89071-c679-4719-803b-xxxxxxxxxxxxxxx';
this.pbiService.getReport(this.reportId).subscribe(embedConfig=> {
this.embedConfig=embedConfig;
// console.log(this.customerName);
constpowerbi=newpbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory);
constmodels=pbi.models;

constfilter= {
target: {
table:'Customer',
column:'Customer'
},
operator:'Is',
values: [this.id]
};

constconfig= {
type:'report',
tokenType:models.TokenType.Embed,
accessToken:this.embedConfig.EmbedToken.token,
embedUrl:this.embedConfig.EmbedUrl,
id:this.embedConfig.Id,
permissions:models.Permissions.All,
filters: [filter],
settings: {
filterPaneEnabled:false,
navContentPaneEnabled:false
}
};
// Even though an error is displayed, the parameter still works.
constreport=powerbi.embed(this.reportContainer.nativeElement, config);
report.iframe.frameBorder='none';

report.on('loaded', function(event)
{
console.log('Ready...');

// Retrieve the report id.
constreportId=report.getId();

console.log('Report Id: '+reportId);

report.getPages()
.then(function (pages) {
pages.forEach(function(page) {
constlog=page.name+' - '+page.displayName;
console.log(log);
});
});
});
});
}

Viewing all articles
Browse latest Browse all 17878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>