Example #1
0
        /// <summary>
        /// Starts a process of creating a report by specified template and record.
        /// </summary>
        /// <param name="userConnection">The user connection to bind a task to a user.</param>
        /// <param name="reportGenerationConfig">The identifier of a data record.</param>
        /// <returns>The identifier of created report generation task.</returns>
        public virtual Guid StartReportGenerationTask(UserConnection userConnection, AsyncReportGeneratorConfiguration reportGenerationConfig)
        {
            var reportGenerationTask   = _reportGenerator.StartReportGenerationTask(userConnection, reportGenerationConfig);
            var reportGenerationTaskId = reportGenerationTask.TaskId;

            CacheReportGenerationTask(reportGenerationTask, userConnection);
            Log.Info($"The report generation task with ID = {reportGenerationTaskId} has been started.");
            return(reportGenerationTaskId);
        }
Example #2
0
        private Guid StartCreateReport(Guid recordId, Guid templateId)
        {
            var reportGenerationConfig = new AsyncReportGeneratorConfiguration {
                RecordId         = recordId,
                ReportTemplateId = templateId,
                CallbackUrl      = CallbackServiceUrl,
            };

            return(ReportGenerationService.StartReportGenerationTask(UserConnection, reportGenerationConfig));
        }
Example #3
0
        /// <inheritdoc cref="IAsyncReportGenerator.StartReportGenerationTask"/>
        public virtual ReportGenerationTask StartReportGenerationTask(UserConnection userConnection, AsyncReportGeneratorConfiguration configuration)
        {
            var report           = PrepareReport(userConnection, configuration);
            var reportName       = GetReportName(report);
            var conversionTaskId = StartReportConversionTask(report, configuration.CallbackUrl);

            return(new ReportGenerationTask(conversionTaskId, reportName));
        }