Working with Resource Assignments

Variance tracking is an important part of project management because it allows you to compare actual results against planned baselines. Aspose.Tasks for .NET provides direct access to variance values through the Asn class, enabling developers to analyze project deviations programmatically.

Dealing Variances

The Asn class exposes several properties for handling variance in an assignment’s baseline values and actuals:

To view assignment variances in Microsoft Project manually:

  1. Go to the Task Usage screen.
  2. From the Insert menu, select Column.
  3. Add the variance columns you need.

Getting Assignment Variance in Aspose.Tasks

The following example demonstrates how to access the WorkVariance value of a resource assignment programmatically. This allows you to determine how much actual work deviates from the baseline.

 1Project project = new Project("New Project.mpp");
 2
 3// Print assignment variances
 4foreach (ResourceAssignment ra in project.ResourceAssignments)
 5{
 6    Console.WriteLine(ra.Get(Asn.WorkVariance));
 7    Console.WriteLine(ra.Get(Asn.CostVariance));
 8    Console.WriteLine(ra.Get(Asn.StartVariance));
 9    Console.WriteLine(ra.Get(Asn.FinishVariance));
10}

FAQ

Q: Do I need Microsoft Project installed to read variance values?

Q: Can I access all types of variance (cost, start, finish, work) with Aspose.Tasks?

Q: Are variance values preserved when saving the project back to Microsoft Project?

Conclusion

Variance analysis in Aspose.Tasks for .NET makes it possible to programmatically track project deviations without relying on Microsoft Project. By using properties such as CostVariance, StartVariance, FinishVariance, and WorkVariance, developers can generate detailed progress reports, monitor project health, and ensure better cost and schedule control directly from C# code.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.