0

如何通过 PSI 检索筛选的项目列表?我已经通过 Project Web 服务和 ReadProjectStatus 方法进行了尝试,但那里没有过滤功能。

内部 PWA Web 服务中还有 ProjectGetProjectCenterProjectsForGridJson 方法,实际上没有记录,因此无法使用...

您知道如何实现这一目标吗?有没有一种本地方法来进行这种过滤?

谢谢 !

4

1 回答 1

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;
    }
于 2015-03-13T12:59:53.937 回答