Exemple #1
0
        public async Task ExecuteReportReturnDetails()
        {
            var service    = new ReportExecutionService(RepositoryInjector.GetInjector <JAPISessionRepository>());
            var reportPath = "/reports/X2R_User_Report";

            try
            {
                var requestObject = new ReportExecutionRequest
                {
                    reportUnitUri = reportPath,
                    async         = true,
                    outputFormat  = "pdf",
                };

                var reportJob = await service.ExecuteReportAsync(requestObject);

                if (reportJob != null && !string.IsNullOrEmpty(reportJob.requestId))
                {
                    if (!service.cancelStatuses.Contains(reportJob.status))
                    {
                        Task <ExecutionStatus> pollTask = service.PollReport(reportJob.requestId);
                        pollTask.Wait();
                    }

                    var jobDetails = await service.GetExecutionDetails(reportJob.exports[0].id);


                    Debug.Assert(true);
                }
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }