Forum Discussion
Power BI Export to file Error
The export job never finishes.
It never hits the polling function.
The await on the export never comes back.
It should return in a second, max, because the report I'm exporting says only "Test"
Is there some hidden setting or framework version I need to set my project to?
I'm copying the documentation code and it is not working.
Doesn't look like the sample code to me. I think you are putting one "await" on top of another one?
- Anonymous6 years agoNot applicable
/////// Export sample /////// public async Task<string> PostExportRequest( Guid reportId, Guid groupId, FileFormat format) { var client = GetPowerBiClient(); // new Power BI client instance var pages = client.Reports.GetPages(groupId, reportId); var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration { Settings = new ExportReportSettings { Locale = "en-us", }, }; var exportRequest = new ExportReportRequest { Format = format, PowerBIReportConfiguration = powerBIReportExportConfiguration, }; Export export = null; try { export = await client.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest); // this never returns } catch (Exception ex) { } // Save the export ID, you'll need it for polling and getting the exported file return export.Id; }Here's my full function.
Do I have a double await?- lbendlin6 years agoSuper User
You define the pages but then do not specify them in the request.
(You also use Export export instead of var export but I guess that doesn't matter)
- Anonymous6 years agoNot applicable
I deleted the line with 'pages' since yes, I'm not using them.
If I don't specify pages, then it'll export the whole report, right?