Working with Task Baselines
Task baselines in Microsoft Project allow project managers to capture the initial plan of a task, including duration, work, and cost.
Using Aspose.Tasks for .NET, developers can programmatically create, edit, and analyze task baselines in MPP files.
This section introduces the available options for working with task baselines.
Features
With Aspose.Tasks for .NET, developers can:
- Create baselines for individual tasks or the entire project
- Modify baseline properties such as duration, scope, and cost
- Delete or reset baselines when plans change
- Compare baseline and actual data, e.g. to identify schedule or cost variances
- Generate custom reports by programmatically analyzing baseline data
Example: Setting a Task Baseline
The following example demonstrates how to set a baseline for a task in a Microsoft Project file.
1var project = new Project("input.mpp");
2
3// Access a task by ID
4Task task = project.RootTask.Children.GetById(1);
5
6// Set baseline for the entire project, including this task
7project.SetBaseline(BaselineType.Baseline);
8
9// Save updated project
10project.Save("output.mpp", SaveFileFormat.Mpp);
This simple snippet captures the initial plan for tasks, enabling you to compare it with actual progress later.
Conclusion
Task baselines are essential for monitoring performance and ensuring accountability in project management. With Aspose.Tasks for .NET, developers can fully automate the creation, modification, and analysis of baselines in Microsoft Project files.
This allows for advanced scenarios such as automated reporting, integration with business intelligence tools, and proactive management of cost and schedule variances—all without the need to install Microsoft Project.