public async Task GetExecutedReportContentShouldNotHappenThisWay() { // f7bebd78-965c-4e08-ac27-6ade43f75163/exports/383b0c75-551d-43b0-9736-06af2fa4610d/outputResource var service = new ReportExecutionService(RepositoryInjector.GetInjector <JAPISessionRepository>()); var reportPath = "/reports/X2R_User_Report"; var reportName = "X2R_User_Report.pdf"; var requestObject = new ReportExecutionRequest { reportUnitUri = reportPath, async = false, outputFormat = "pdf", }; try { Task <ReportExecutionResponse> execTask = service.ExecuteReportAsync(requestObject); execTask.Wait(); var execResponse = execTask.Result; if (!string.IsNullOrEmpty(execResponse.requestId) && execResponse.status.Equals("ready", StringComparison.OrdinalIgnoreCase)) { foreach (var export in execResponse.exports) { var downloadPath = System.AppContext.BaseDirectory + reportName + ".pdf"; if (System.IO.File.Exists(downloadPath)) { System.IO.File.Delete(downloadPath); } var rawBytes = await service.GetExecutionOuput(execResponse.requestId, export.id); System.IO.File.WriteAllBytes(downloadPath, rawBytes); } } Debug.Assert(true); } catch (Exception ex) { Assert.Fail(ex.Message); } }