My problem is that I want to be able to delete a report based on its ID. I've seen that it's possible to delete a dataset, which will subsequently delete the related reports. But when I have a report ID, how can I get to its dataset?
This is the complete story:
For a webpage we want to provide power bi reports to users. We create the power bi reports ourselves and then upload them to azure. For uploading the reports I used the C# code from MS sample project (PowerBI-embedded.sln - PovisionSample) as a basis.
We also want to add a description to a report and present to the user an overview of available reports, thus we decided to store the list of available reports in an MSSQL table. In this table we store a userfriendly name, a description and the ID of the report. That ID is used to retrieve the report when the user wants to see it.
To retrieve the report I call:
client.Reports.GetReportsAsync(_workspaceCollectionName, _workspaceId)
I then have all the reports in the the workspace. I use the one with the matching ID from the MSSQL table:
Report report = reportsResponse.Value.FirstOrDefault(r => r.Id == reportId);
This works without problem. But as said, the problem is when we delete a record in the MSSQL table containing the reports; we also want to delete the corresponding report in the workspace.
As far as I can see now I should also store the dataset ID in my SQL table, solely for the case if I want to delete the report. So my table needs the report ID for opening the power BI report and the dataset ID for removal, because I don't see how to get to the dataset with a report ID.......any suggestions?
Thanks and regards,
Gertjan
↧
Delete report, or dataset
↧