我正在使用 power bi 嵌入式包来嵌入 power bi 报告 -https://github.com/microsoft/powerbi-client-react https://github.com/microsoft/powerbi-client-react
报告嵌入在编辑模式中,因此用户可以创建或编辑报告。现在我有一个保存按钮,一旦用户对 power bi 报告进行更改,我想将报告保存在数据库中。你能告诉我如何触发报告事件吗?看起来允许的保存事件不起作用。
另外,如果我必须在用户进行更改或创建报告后获取报告的实例,如何再次获取报告的实例以反映新的更改?
<PowerBIEmbed
embedConfig = {{
type: 'report', // Supported types: report, dashboard, tile, visual and qna
id: '<Report Id>',
embedUrl: '<Embed Url>',
accessToken: '<Access Token>',
tokenType: models.TokenType.Embed,
viewMode: models.ViewMode.Edit,
settings: {
panes: {
filters: {
expanded: false,
visible: false
}
},
background: models.BackgroundType.Transparent,
}
}}
eventHandlers = {
new Map([
['loaded', function () {console.log('Report loaded');}],
['rendered', function () {console.log('Report rendered');}],
['error', function (event) {console.log(event.detail);}]
])
}
cssClassName = { "report-style-class" }
getEmbeddedComponent = { (embeddedReport) => {
this.report = embeddedReport as Report;
}}
/>
报告已正确嵌入,但现在在有人进行更改后,如何再次获取更新的报告实例,以便获得视觉效果并将其存储在数据库中?