共用方式為


EntityType: Project (ProjectData service)

In this article
Definition
Parent element
Child elements

Contains the properties that define the reporting data for a project in the ProjectData service.

Example

The following REST query uses the Projects entity set and the ProjectId key to get the start and finish dates for a specified project. The query is all on one line.

http://<pwa_url>/_api/ProjectData/Projects
    ?$select=ProjectStartDate,ProjectFinishDate
    &$filter=ProjectId eq guid'7e910f5b-95e2-e111-8d29-00155d35d32e'

The following REST query uses the Tasks entity set and the ProjectId key to get the tasks in a specified project. The query is all on one line.

http://<pwa_url>/_api/ProjectData/Tasks
    ?$filter=ProjectId eq guid'7e910f5b-95e2-e111-8d29-00155d35d32e'

The following statement uses LINQ query syntax to retrieve Project entity data from the OData interface of the Project Server reporting tables. To use the statement in an application, set a service reference to the ProjectDataService, and initialize the ReportingData context. The Projects entity set can then be accessed as context.Projects. For more information, see Querying OData feeds for Project 2013 reporting data.

var query =
    from p in Projects
    where p.ProjectStartDate > new DateTime(2012, 1, 1)
    orderby p.ProjectName
    select new
    {
        Project = p.ProjectName,
        StartDate = p.ProjectStartDate,
        FinishDate = p.ProjectFinishDate,
        ProjectCost = p.ProjectCost
    };

The preceding statement can be written by using Lambda expression syntax, as follows:

var query = Projects
    .Where(p => (p.ProjectStartDate > (DateTime?)(new DateTime(2012, 1, 1))))
    .OrderBy(p => p.ProjectName)
    .Select(p => new
    {
        Project = p.ProjectName,
        StartDate = p.ProjectStartDate,
        FinishDate = p.ProjectFinishDate,
        ProjectCost = p.ProjectCost
    });

Either statement creates the following REST URL (all on one line).

http://<pwa_url>/_api/ProjectData/Projects?
    $filter=ProjectStartDate gt datetime'2012-01-01T00:00:00'&
    $orderby=ProjectName&
    $select=ProjectName,ProjectStartDate,ProjectFinishDate,ProjectCost

All three of the sample queries get the same data.

Sample results of the Task query

Project

StartDate

FinishDate

ProjectCost

ProjectA

3/1/2012 8:00:00 AM

3/15/2012 5:00:00 PM

$1124.00

ProjectB

3/1/2012 8:00:00 AM

3/24/2012 5:00:00 PM

$2171.00

ProjectC

3/1/2012 8:00:00 AM

3/17/2012 5:00:00 PM

$1968.00

Definition

<EntityType Name="Project">
  <Key>
    <PropertyRef Name="ProjectId" />
  </Key>
  <Property Name="EnterpriseProjectTypeDescription" Type="Edm.String" />
  . . .
  <NavigationProperty Name="Tasks" Relationship="ReportingData.Project_Tasks_Task_Project" 
                      ToRole="Task_Project" FromRole="Project_Tasks" />
  . . .
</EntityType>

Parent element

Element

Description

ReportingData

The schema for the reporting data in the ProjectData service.

Child elements

Child elements are properties of a project and navigation properties of that project. Attributes of the Property elements specify the property name and type, and whether the property can be a null value. The NavigationProperty elements specify collections of entities, such as tasks and assignments, that are associated with a project. A navigation property uses an Association element in a query for a related entity or collection

The Key element specifies the property that is the primary key for a project query. ProjectId is the project GUID.

Property elements

The following table lists the Property elements for the Project entity. The Name, Type, and Nullable columns are attribute values for each property.

Attributes values for the Property elements of Project

Name

Type

Nullable

Description

EnterpriseProjectTypeDescription

Edm.String

true

The description of an enterprise project type (EPT).

EnterpriseProjectTypeId

Edm.Guid

true

The GUID of an enterprise project type.

EnterpriseProjectTypeIsDefault

Edm.Boolean

true

Specifies whether an enterprise project type is the default.

EnterpriseProjectTypeName

Edm.String

true

The name of an enterprise project type.

OptimizerCommitDate

Edm.DateTime

true

The commit date and time of an Optimizer solution in an analysis.

OptimizerDecisionAliasLookupTableId

Edm.Guid

true

The GUID of an Optimizer decision alias lookup table.

OptimizerDecisionAliasLookupTableValueId

Edm.Guid

true

The GUID of an Optimizer decision alias lookup table value.

OptimizerDecisionID

Edm.Byte

true

The GUID of an Optimizer decision.

OptimizerDecisionName

Edm.String

true

The name of an Optimizer decision.

OptimizerSolutionName

Edm.String

true

The name of an Optimizer solution.

ParentProjectId

Edm.Guid

true

The GUID of a parent project.

PlannerCommitDate

Edm.DateTime

true

The commit date and time for a project in the project portfolio planner.

PlannerDecisionAliasLookupTableId

Edm.Guid

true

The GUID of a project portfolio planner lookup table that stores the forced-in/forced-out value.

PlannerDecisionAliasLookupTableValueId

Edm.Guid

true

The GUID of a value in a project portfolio planner lookup table that stores the forced-in/forced-out value.

PlannerDecisionID

Edm.Byte

true

The GUID of a project portfolio planner result.

PlannerDecisionName

Edm.String

true

The name of a project portfolio planner result.

PlannerEndDate

Edm.DateTime

true

The project portfolio planner end date and time.

PlannerSolutionName

Edm.String

true

The name of the project portfolio planner solution.

PlannerStartDate

Edm.DateTime

true

The project portfolio planner start date and time.

ProjectActualCost

Edm.Decimal

true

The costs incurred for work that has already been performed on a project.

ProjectActualDuration

Edm.Decimal

true

The actual length of a project.

ProjectActualFinishDate

Edm.DateTime

true

The date that a project was complete.

ProjectActualOvertimeCost

Edm.Decimal

true

The cost incurred for overtime work that has already been performed on a project.

ProjectActualOvertimeWork

Edm.Decimal

true

The overtime work that has already been performed on a project.

ProjectActualRegularCost

Edm.Decimal

true

The cost incurred for regular, nonovertime work that has already been performed on a project.

ProjectActualRegularWork

Edm.Decimal

true

The regular, nonovertime work that has already been performed on a project.

ProjectActualStartDate

Edm.DateTime

true

The project actual start date and time.

ProjectActualWork

Edm.Decimal

true

The work that has already been performed on a project.

ProjectACWP

Edm.Decimal

true

The actual cost incurred for work that has already been performed on a project, up to the project status date or today's date.

ProjectAuthorName

Edm.String

true

The name of the author of the project.

ProjectBCWP

Edm.Decimal

true

The budgeted cost of work that has already been performed on a project.

ProjectBCWS

Edm.Decimal

true

The budgeted cost of work that is scheduled for a project.

ProjectBudgetCost

Edm.Decimal

true

The projected cost of a project.

ProjectBudgetWork

Edm.Decimal

true

The projected amount of work on a project.

ProjectCalculationsAreStale

Edm.Boolean

false

True if project schedule calculations are not up to date.

ProjectCalendarDuration

Edm.Int32

true

The total span of active working time for all tasks in a project, based on the project calendar that is specified in the Project Information dialog box.

ProjectCategoryName

Edm.String

true

The name of a project category.

ProjectCompanyName

Edm.String

true

The name of the company for a project.

ProjectCost

Edm.Decimal

true

The total cost for a project.

ProjectCostVariance

Edm.Decimal

true

The difference between baseline costs and scheduled costs of a project.

ProjectCPI

Edm.Decimal

true

The project Cost Performance Index—the ratio of earned value (Budgeted Cost of Work Performed) to actual cost.

ProjectCreatedDate

Edm.DateTime

false

The date that a project was created.

ProjectCurrency

Edm.String

true

The project currency character code.

ProjectCV

Edm.Decimal

true

The project cost variance, which is the difference between the budgeted cost of work performed and the actual cost of the project.

ProjectCVP

Edm.Decimal

true

Cost variance, which is the difference between the cost of work performed and the actual cost of scheduled work.

ProjectDepartments

Edm.String

true

The departments that are included in a project.

ProjectDescription

Edm.String

true

The description of a project.

ProjectDuration

Edm.Decimal

true

The duration of a project.

ProjectDurationVariance

Edm.Decimal

true

The project duration variance.

ProjectEAC

Edm.Decimal

true

The project Estimate at Completion—the expected total cost of a project based on performance up to the status date.

ProjectEarlyFinish

Edm.DateTime

true

The early finish date and time of a project.

ProjectEarlyStart

Edm.DateTime

true

The early start date and time of a project.

ProjectEarnedValueIsStale

Edm.Boolean

false

True if earned value fields are out of date.

ProjectEnterpriseFeatures

Edm.Boolean

false

True if the project is an enterprise project.

ProjectFinishDate

Edm.DateTime

true

The scheduled finish date and time of a project.

ProjectFinishVariance

Edm.Decimal

true

The variance at the completion of a project.

ProjectFixedCost

Edm.Decimal

true

The fixed cost of a project.

ProjectId

Edm.Guid

false

Key
The GUID that identifies a project.

ProjectKeywords

Edm.String

true

The keywords for a project.

ProjectLateFinish

Edm.DateTime

false

The late finish date and time of a project.

ProjectLateStart

Edm.DateTime

true

The late start date and time of a project.

ProjectManagerName

Edm.String

true

The name of a project manager.

ProjectModifiedDate

Edm.Datetime

false

The date and time that a project was last modified.

ProjectName

Edm.String

true

The name of a project.

ProjectOvertimeCost

Edm.Decimal

true

The project overtime cost.

ProjectOvertimeWork

Edm.Decimal

true

The project overtime work.

ProjectOwnerId

Edm.Guid

false

The GUID of a project owner.

ProjectOwnerName

Edm.String

true

The name of a project owner.

ProjectPercentCompleted

Edm.Int16

true

The percent of a project that is complete.

ProjectPercentWorkCompleted

Edm.Int16

true

The percent of project work that is complete.

ProjectWorkspaceInternalUrl

Edm.String

true

The URL of the project site.

ProjectRegularCost

Edm.Decimal

true

The regular, nonovertime cost of a project.

ProjectRegularWork

Edm.Decimal

true

The amount of regular, nonovertime work in a project.

ProjectRemainingCost

Edm.Decimal

true

The remaining cost in a project for work that has not been performed.

ProjectRemainingDuration

Edm.Decimal

true

The amount of time that remains to complete a project.

ProjectRemainingOvertimeCost

Edm.Decimal

true

The remaining overtime cost of a project.

ProjectRemainingOvertimeWork

Edm.Decimal

true

The remaining overtime work in a project.

ProjectRemainingRegularCost

Edm.Decimal

false

The remaining regular, nonovertime cost of a project.

ProjectRemainingRegularWork

Edm.Decimal

true

The remaining nonovertime work in a project.

ProjectRemainingWork

Edm.Decimal

true

The remaining work in a project.

ProjectResourcePlanWork

Edm.Decimal

true

Work involving the allocation of resources on a project.

ProjectSPI

Edm.Decimal

true

The project schedule performance index.

ProjectStartDate

Edm.DateTime

true

The project start date and time.

ProjectStartVariance

Edm.Decimal

true

The variance at the start of a project.

ProjectStatusDate

Edm.DateTime.

true

The status date and time of a project.

ProjectSubject

Edm.String

true

The subject of a project.

ProjectSV

Edm.Decimal

true

The project schedule variance, which is the difference between earned value (budgeted cost of work performed) and planned value (budgeted cost of work scheduled).

ProjectSVP

Edm.Decimal

true

The project Schedule Variance Percentage—schedule variance divided by the project budgeted cost of work scheduled.

ProjectTCPI

Edm.Decimal

true

The To-Complete Performance Index. This is an indication of how much work should be performed to meet a project schedule.

ProjectTitle

Edm.String

true

The title of a project.

ProjectType

Edm.Int32

false

The enumerated value that represents the type of a project.

ProjectVAC

Edm.Decimal

true

The project Variance At Completion—the difference between baseline cost and the estimate at completion.

ProjectWork

Edm.Decimal

true

The work of a project.

ProjectWorkspaceInternalUrl

Edm.String

true

The URL of a project site.

ProjectWorkVariance

Edm.Decimal

true

The work variance of a project.

ResourcePlanUtilizationDate

Edm.DateTime

true

The start date and time for use of the resource plan.

ResourcePlanUtilizationType

Edm.Int16

true

An enumerated value that represents the utilization type of a resource plan.

The following table lists attribute values for the NavigationProperty elements of the Project entity. The Name and Relationship columns contain attribute values for each navigation property.

Each Relationship attribute contains two pairs of names; each pair of names indicates the navigation direction. The first pair starts with the entity type that has the primary, or starting, role in the navigation. The second pair starts with the entity type that has the secondary, or dependent, role in the navigation. For example, for the Tasks navigation property, the primary type is Project, and the secondary type is Task.

With the Project entity, when navigating from a project to the collection of tasks, the FromRole is Project_Tasks, and the ToRole is Task_Project. The roles are reversed for the EntityType: Task (ProjectData service) entity type.

Attributes of the NavigationProperty elements

Name

Relationship

Description

AssignmentBaselines

Project_AssignmentBaselines_AssignmentBaseline_Project

Establishes navigation from a project to a collection of assignment baselines and from an assignment baseline to a project.

Assignments

Project_Assignments_Assignment_Project

Establishes navigation from a project to a collection of assignments and from an assignment to a project.

Deliverables

Project_Deliverables_Deliverable_Project

Establishes navigation from a project to a collection of deliverables and from a deliverable to a project.

Dependencies

Project_Dependencies_Deliverable_DependentProjects

Establishes navigation from a project to a collection of dependencies and from a deliverable to a dependent project.

Issues

Project_Issues_Issue_Project

Establishes navigation from a project to a collection of issues and from an issue to a project.

Risks

Project_Risks_Risk_Project

Establishes navigation from a project to a collection of risks and from a risk to a project.

StagesInfo

Project_StagesInfo_ProjectWorkflowStageData_Project

Establishes navigation from a project to a collection of workflow stages and from a workflow stage to a project.

Tasks

Project_Tasks_Task_Project

Establishes navigation from a project to a collection of tasks and from a task to a project.

See also

Reference

Projects

ReportingData

Concepts

Querying OData feeds for Project 2013 reporting data