Forum Discussion
Delete report, or dataset
- 9 years ago
I found a possible solution in using the ID of the import class that was used when uploading:
// Import PBIX file from the file str Import import = client.Imports.PostImportWithFile(_workspaceCollectionName, _workspaceId, file, datasetName);
This gives me an import.Id which I can store (instead of storing the report id like I do now).
When looking up the report I can lookup the import and find the report:
Import import = client.Imports.GetImportById(_workspaceCollectionName, _workspaceId, importId); import.Reports[0].Id;
We deleting a report I can find the corresponding dataset:
Import import = client.Imports.GetImportById(_workspaceCollectionName, _workspaceId, importId); import.Datasets[0].Id;
It looks like the imports are persited, at least for a couple of months, so I assume this should be ok.
Thanks for your suggestion!!
Unfortunately the dataset/report names are not unique, it's allowed to upload reports with the same name.
How can it be that there's no way to get a report's dataset or to get a dataset's reports??
I found a possible solution in using the ID of the import class that was used when uploading:
// Import PBIX file from the file str Import import = client.Imports.PostImportWithFile(_workspaceCollectionName, _workspaceId, file, datasetName);
This gives me an import.Id which I can store (instead of storing the report id like I do now).
When looking up the report I can lookup the import and find the report:
Import import = client.Imports.GetImportById(_workspaceCollectionName, _workspaceId, importId); import.Reports[0].Id;
We deleting a report I can find the corresponding dataset:
Import import = client.Imports.GetImportById(_workspaceCollectionName, _workspaceId, importId); import.Datasets[0].Id;
It looks like the imports are persited, at least for a couple of months, so I assume this should be ok.