如何通过PSI检索已过滤的项目列表?我通过Project Web服务和ReadProjectStatus方法尝试过,但那里没有过滤功能。
内部PWA Web服务中还有ProjectGetProjectCenterProjectsForGridJson方法,实际上没有文档,因此无法使用...
你知道如何实现这个目标吗?是否有本地方式进行此类过滤?
谢谢!
答案 0 :(得分:0)
您可以使用过滤查询。
private static Guid EnsureEnterpriseProject(string ProjectName)
{
SvcProject.ProjectDataSet ProjectDs = new SvcProject.ProjectDataSet();
PSLibrary.Filter ProjectFilter = new Microsoft.Office.Project.Server.Library.Filter();
ProjectFilter.FilterTableName = ProjectDs.Project.TableName;
ProjectFilter.Fields.Add(new PSLibrary.Filter.Field(ProjectFilter.Project.TableName, ProjectFilter.Project.[Give column Name].ColumnName, PSLibrary.Filter.SortOrderTypeEnum.None));
ProjectFilter.Fields.Add(new PSLibrary.Filter.Field(ProjectFilter.Project.TableName, ProjectFilter.Project.[Give column Name].ColumnName, PSLibrary.Filter.SortOrderTypeEnum.None));
ProjectFilter.Fields.Add(new PSLibrary.Filter.Field(ProjectFilter.Project.TableName, ProjectFilter.Project.[Give column Name].ColumnName, PSLibrary.Filter.SortOrderTypeEnum.None));
ProjectFilter.Fields.Add(new PSLibrary.Filter.Field(ProjectFilter.Project.TableName, ProjectFilter.Project.[Give column Name].ColumnName, PSLibrary.Filter.SortOrderTypeEnum.None));
PSLibrary.Filter.FieldOperator existingProject = new PSLibrary.Filter.FieldOperator(PSLibrary.Filter.FieldOperationType.Equal, ProjectDs.Project.[Give Column Name].ColumnName, ProjectName);
projecteFilter.Criteria = existingProject;
string filterXml = ProjectFilter.GetXml();
ProjectDs = ServiceContext.Current.PSI.ProjectService.ReadProject(filterXml, false);
if (ProjectDs.Project.Count >= 1)
{
//Get the desired value from the dataset.
}
return Valuegotfromdataset;
}