I am using power bi embedded package to embed power bi report - https://github.com/microsoft/powerbi-client-react
Report is embedded in the edit mode so user can create or edit the report. Now I have a save button and once the user makes changes to the power bi report, I would like to save the report in the database. Can you tell me how can I trigger the report event. It looks like allowed events of save does not work.
Also, if I have to get instance of the report after user has made changes or created the report, how can I get the instance of the report again to reflect new changes?
<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;
}}
/>
Report is being embedded correctly but now after someone has made changes, how do I get the updated report instance again so I can get visuals and store it in the database?