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:
- Reference the Project.asmx service (ex: http://servername/pwa/_vti_bin/psi/Project.asmx)
- Use the ReadProjectEntities method to retrieve a DataSet and pass it a
ProjectEntityType
ofTask
,Assignment
andResource
.
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 ProjectEntityType
s.
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.
精彩评论