@mudassir.fayyaz,
I am on 20.2. Working with a test license file.
Here the code:
using System;
using System.Collections.Generic;
using System.IO;
using Aspose.Tasks;
using Aspose.Tasks.Saving;
using Aspose.Tasks.Visualization;
namespace MPP2XLS
{
public class UsingXlsxOptions
{
public static void Main()
{
Aspose.Tasks.License license = new Aspose.Tasks.License();
license.SetLicense("C:/01_IN/Aspose.Tasks.lic");
// The path to the documents directory.
string dataDir = "C:/01_IN/";
string dataFile = "Projekt1";
string dataFormat = ".mpp";
// ExStart:UsingXlsxOptions
// Read the input Project file
Project project = new Project(dataDir + dataFile + dataFormat);
project.Set(Prj.DateFormat, DateFormat.DateDdMmYyyy);
// add the columns to be exported
var columns = new List<ViewColumn>
{
new GanttChartColumn("UniqueId", 20, Field.TaskUniqueID),
new GanttChartColumn("Name", 150, Field.TaskName),
new GanttChartColumn("Start", 100, Field.TaskStart),
new GanttChartColumn("End", 100, Field.TaskFinish),
new GanttChartColumn("R-Initials", 100, Field.TaskResourceInitials),
new GanttChartColumn("R-Names", 100, Field.TaskResourceNames),
new GanttChartColumn("Work", 50, Field.TaskWork),
new GanttChartColumn("Code2", 100, Field.TaskOutlineCode2),
new GanttChartColumn("Code1", 100, Field.TaskOutlineCode1),
new GanttChartColumn("UniqueID-Pre", 100, Field.TaskUniquePredecessors),
new GanttChartColumn("UniqueID-Suc", 100, Field.TaskUniqueSuccessors),
};
XlsxOptions options = new XlsxOptions
{
View = new ProjectView(columns),
PresentationFormat = PresentationFormat.GanttChart
};
CsvOptions csvOptions = new CsvOptions
{
View = new ProjectView(columns),
PresentationFormat = PresentationFormat.GanttChart
};
project.Save(dataDir + dataFile +"_OUT.xlsx", options);
project.Save(dataDir + dataFile + "_OUT.csv", csvOptions);
// ExEnd:UsingXlsxOptions
}
}
}
By the way, the Unique-ID predecessor and successor columns are not working too…
How can I send you the mpp file?
Thanks for helping.