Resource Work Variances

Work variance is the difference between the estimated work (the baseline) and actual work performed.

Handling Variances

The WorkVariance property exposed by the Resource class handles variance in work:

Microsoft Project View of Resource Work Variance

To see the resource work variance in Microsoft Project:

  1. On the Resource Sheet, go to the Insert menu and select Column.
  2. Add the Variance column.

Getting Resource Work Variance in Aspose.Tasks

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

 1// Read the input Project file
 2System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"WorkVariance.mpp");
 3Key<System::SharedPtr<Resource>, AsnKey> asnRsc = Asn::Resource();
 4    
 5{
 6    auto ra_enumerator = (project->get_ResourceAssignments())->GetEnumerator();
 7    decltype(ra_enumerator->get_Current()) ra;
 8    while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
 9    {
10        System::SharedPtr<Resource> rsc;
11        
12        // C# preprocessor directive: #if !__cplusplus
13        
14        
15        // C# preprocessor directive: #endif
16        
17        rsc = ra->Get(asnRsc);
18        
19        double d = rsc->Get<double>(Rsc::WorkVariance());
20        
21        System::Console::WriteLine(d);
22    }
23}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.