开发者

How do I get the Resource Usage view using the PSI 2007

开发者 https://www.devze.com 2023-02-17 06:30 出处:网络
Please excuse me if I use incorrect terms or concepts. Seems I am in the mist of a crash course on MS Project, Project Server, and the PSI...

Please excuse me if I use incorrect terms or concepts. Seems I am in the mist of a crash course on MS Project, Project Server, and the PSI...

Project Professional provides the 开发者_StackOverflow中文版Resource Usage view that lists a given Resource, the Tasks they have been assigned to, and the amount of scheduled Work for a given day.

Is this information available in Project Server and how would I read it using the PSI?

Thanks.

  • Jason


If you're just getting started with PSI, I'd strongly recommend downloading and using the ProjTool app that is part of the Project 2007 SDK.

I haven't done too much work with Resources, but after taking a quick look.. here is how I'd approach it:

  1. Reference the Project.asmx service (ex: http://servername/pwa/_vti_bin/psi/Project.asmx)
  2. Use the ReadProjectEntities method to retrieve a DataSet and pass it a ProjectEntityType of Task, Assignment and Resource.

Define some entity types:

public const int ENT_TYPE_TASK = 2;
public const int ENT_TYPE_RESOURCE = 4;
public const int ENT_TYPE_ASSIGNMENT = 8;

Then you can read the data:

int entity = ENT_TYPE_TASK | ENT_TYPE_ASSIGNMENT | ENT_TYPE_RESOURCE;
ProjectDataSet dataSet = project.ReadProjectEntities(projectUid, entity, DataStoreEnum.PublishedStore);
// do stuff with these tables...
//dataSet.Task
//dataSet.Assignment
//dataSet.ProjectResource

ReadProjectEntities is nice because you can read only the part of the project you need... if you need more than the Task table then you can use a logical OR to get additional ProjectEntityTypes.

As for the assigned work, it looks like that is also in the Assignment table, but I think you'll have to do some calculating.

0

精彩评论

暂无评论...
验证码 换一张
取 消