Working With Assignment Variances

Dealing Variances

The Asn class exposes several properties for handling variance in an assignment’s baseline values and the actual cost, start date, finish date and work:

To see resource assignment variances in Microsoft Project:

  1. On the Task Usage screen, select Insert and ten Columns.
  2. Add the desired columns.

Getting Assignment Variance in Aspose.Tasks

The following code example demonstrates how to get the resource work variance using Aspose.Tasks.

 1// Create project instance
 2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentVariance.mpp");
 3    
 4// Print assignment variances
 5    
 6{
 7    auto ra_enumerator = (project1->get_ResourceAssignments())->GetEnumerator();
 8    decltype(ra_enumerator->get_Current()) ra;
 9    while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
10    {
11        System::Console::WriteLine(System::ObjectExt::Box<Duration>(ra->Get<Duration>(Asn::WorkVariance())));
12        System::Console::WriteLine(ra->Get<double>(Asn::CostVariance()));
13        System::Console::WriteLine(System::ObjectExt::Box<Duration>(ra->Get<Duration>(Asn::StartVariance())));
14        System::Console::WriteLine(System::ObjectExt::Box<Duration>(ra->Get<Duration>(Asn::FinishVariance())));
15    }
16}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.