Working With Assignment Variances
Contents
[
Hide
Show
]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:
- CostVariance handles the variance in cost against an assignment’s baseline (double).
- StartVariance handles the variance in start date against an assignments baseline (integer).
- FinishVariance handles the variance in end date against an assignments baseline (integer).
- WorkVariance handles the variance in work against an assignment’s baseline (double).
To see resource assignment variances in Microsoft Project:
- On the Task Usage screen, select Insert and ten Columns.
- 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}