public string GenerateAsciiFile(long id, string title, string mimeType, string[] visibleColumns)
{
string ext = "";
string path = "";
DatasetManager datasetManager = new DatasetManager();
try
{
DatasetVersion datasetVersion = datasetManager.GetDatasetLatestVersion(id);
AsciiWriter writer = new AsciiWriter(TextSeperator.comma);
// Javad: It is better to have a list of tuple IDs and pass it to the AddDataTuples method.
// This method is using a special iterator to reduce the number of queries. 18.11.2016
List <long> datatuples = new List <long>(); //GetFilteredDataTuples(datasetVersion);
long datastuctureId = datasetVersion.Dataset.DataStructure.Id;
path = generateDownloadFile(id, datasetVersion.Id, datastuctureId, "data", ext, writer);
if (visibleColumns != null)
{
writer.VisibleColumns = visibleColumns;
}
writer.AddDataTuples(datasetManager, datatuples, path, datastuctureId);
return(path);
}
finally
{
datasetManager.Dispose();
}
}