Пример #1
0
        public Task ExportResultsToExcelAsync(IndividualSimulation individualSimulation, string fileName, bool launchExcel = true)
        {
            var exportOption = new DataColumnExportOptions
            {
                ColumnNameRetriever = x => _quantityDisplayPathMapper.DisplayPathAsStringFor(individualSimulation, x)
            };

            return(_dataRepositoryTask.ExportToExcelAsync(individualSimulation.DataRepository, fileName, launchExcel, exportOption));
        }
Пример #2
0
        private async Task <ObservedDataMapping> exportObservedData(DataRepository observedData, QualifcationConfiguration configuration, PKSimProject project)
        {
            var observedDataOutputFolder    = configuration.ObservedDataFolder;
            var removeIllegalCharactersFrom = FileHelper.RemoveIllegalCharactersFrom(observedData.Name);
            var csvFullPath = Path.Combine(observedDataOutputFolder, $"{removeIllegalCharactersFrom}{Constants.Filter.CSV_EXTENSION}");
            var xlsFullPath = Path.Combine(observedDataOutputFolder, $"{removeIllegalCharactersFrom}{Constants.Filter.XLSX_EXTENSION}");

            _logger.AddDebug($"Observed data '{observedData.Name}' exported to '{csvFullPath}'", project.Name);
            await _dataRepositoryTask.ExportToCsvAsync(observedData, csvFullPath);

            _logger.AddDebug($"Observed data '{observedData.Name}' exported to '{xlsFullPath}'", project.Name);
            await _dataRepositoryTask.ExportToExcelAsync(observedData, xlsFullPath, launchExcel : false);

            return(new ObservedDataMapping
            {
                Id = observedData.Name,
                Path = relativePath(csvFullPath, configuration.OutputFolder)
            });
        }