We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Best way to create big MPP

Hello,
we are trying to create MsProject document with ~7000 tasks and looking for best solution from performance point of view.
We tried the following ways:
Case 1:
- CalculationModel.None
- Add 7000 tasks (pretty fast) but there was not UID, Duration, Start, Finish, Predecessors values, so RecalculateProject do nothing.


Case 2:
- CalculationMode.Manual
- Add 7000 tasks (pretty fast) and values UID, Duration, Start, Finish, Predecessors were set up.
- Add task links: foreach with project.TaskLinks.Add(predecessorTask, successorTask, predecessorType) - works extremelly slow.

Finally we were able to get document in a 3 hours.

Can you advice the best solution for huge documents?

Here is code sample:

public static void Run()
{
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);
var tasksLicense = new License();
tasksLicense.SetLicense(dataDir + @"\Aspose.Tasks.lic");
try
{
Project project = new Project(dataDir + “Blank2010.mpp”);
project.CalculationMode = CalculationMode.Manual;

for (int i = 0; i <= 7000; i++)
{
Task task = project.RootTask.Children.Add($“Summary{i}”);
task.Set(Tsk.IsManual, true);
task.Set(Tsk.Duration, project.GetDuration(1, TimeUnitType.Day));
task.Set(Tsk.Start, DateTime.Now.AddDays(i));
task.Set(Tsk.Finish, DateTime.Now.AddDays(i+1));
}

var tasks = project.RootTask.Children.ToArray();
for (int i = 10; i < tasks.Length-10; i++)
{
//HERE WE HAVE SLOW PERFORMANCE !!!
TaskLink tsklnk = project.TaskLinks.Add(tasks[i], tasks[i+1], TaskLinkType.FinishToStart);
}
project.Recalculate();
project.Save(dataDir + “CreateTasks_out.mpp”, SaveFileFormat.MPP);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx.");
}
}
Hi Vladimir,

Thank you for writing to Aspose support team.

CalculationMode.None is best of all with respect to performance. We found some bugs with this mode in the current build of the API. In our upcoming release, these issues are resolved and you may use that mode for best performance.

For CalculationMode.Manaul, we are having some issues and these are logged under Id: TASKSNET-1796. It will take quite some time to resolve these issues as the fixing will start by mid this year. You will be notified once any update is received in this regard.

Kashif,


does Java version of the aspose.tasks more stable, faster and contains less issues?

Hi,


Aspose.Tasks for Java is ported from Aspose.Tasks for .NET and lot of effort is put to make both products stable, faster and error free. You may please use it and if any query is there, feel free to write us back.

The issues you have found earlier (filed as TASKSNET-1796) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.