public Task ExportToCsvAsync(ISimulation simulation, DataRepository results, string fileName) { var options = new DataColumnExportOptions { ColumnNameRetriever = x => _quantityDisplayPathMapper.DisplayPathAsStringFor(simulation, x), UseDisplayUnit = false }; return(_dataRepositoryTask.ExportToCsvAsync(results, fileName, options)); }
public Task ExportToCSV() { var fileName = _dialogCreator.AskForFileToSave("Export file", Constants.Filter.CSV_FILE_FILTER, Constants.DirectoryKey.OBSERVED_DATA); if (string.IsNullOrEmpty(fileName)) { return(Task.CompletedTask); } return(_dataRepositoryTask.ExportToCsvAsync(_repository, fileName)); }
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) }); }