Dealing Variances
Contents
[
Hide
Show
]Managing Variances
The ResourceAssignment class exposes several properties for handling variance in an assignment’s baseline values and the actual cost, start date, finish data 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.
Variance columns added in Microsoft Project
Getting Assignment Variance in Aspose.Tasks
The following example shows how to get the resource work variance using Aspose.Tasks.
1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
2// The path to the documents directory.
3String dataDir = Utils.getDataDir(DealingVariances.class);
4
5Project project = new Project(dataDir + "project5.mpp");
6
7for (ResourceAssignment ra : project.getResourceAssignments()) {
8 System.out.println(ra.get(Asn.WORK_VARIANCE));
9 System.out.println(ra.get(Asn.COST_VARIANCE));
10 System.out.println(ra.get(Asn.START_VARIANCE));
11 System.out.println(ra.get(Asn.FINISH_VARIANCE));
12}