Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created November 5, 2024 14:02
Show Gist options
  • Save conholdate-gists/fa6100334be3f4d2acc21e978daa27a4 to your computer and use it in GitHub Desktop.
Save conholdate-gists/fa6100334be3f4d2acc21e978daa27a4 to your computer and use it in GitHub Desktop.
Convert MPP to CSV in C# | Microsoft Project File to Comma Separated File
// Load the input MPP file
Aspose.Tasks.Project project = new Aspose.Tasks.Project("New Project.mpp");
// Create CsvOptions class object
CsvOptions options = new CsvOptions();
// To change what columns will be exported the DataCategory property can be used
// changing the data category from DataCategory.Tasks to DataCategory.Resources
options.DataCategory = DataCategory.Resources;
// Save the output CSV file
project.Save("ResourceView.csv", options);
// Load the input MPP file
Aspose.Tasks.Project project = new Aspose.Tasks.Project("New Project.mpp");
// Create CsvOptions class object
Aspose.Tasks.Saving.CsvOptions options = new Aspose.Tasks.Saving.CsvOptions();
options.TextDelimiter = Aspose.Tasks.Saving.CsvTextDelimiter.Semicolon;
// Save the output CSV file
project.Save("CsvOptions_out.csv", options);
// Load the input MPP file
Aspose.Tasks.Project project = new Aspose.Tasks.Project("New Project.mpp");
// Save the output CSV file
project.Save("ProjectCSV.csv", Aspose.Tasks.Saving.SaveFileFormat.Csv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment