Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sharepoint列表按配置文件属性筛选_Sharepoint_List_Filter_View - Fatal编程技术网

Sharepoint列表按配置文件属性筛选

Sharepoint列表按配置文件属性筛选,sharepoint,list,filter,view,Sharepoint,List,Filter,View,如何根据当前用户的配置文件属性筛选Sharepoint(WSS 3.0)中的列表。例如,我有一个带有部门列的列表,我希望根据当前用户的部门(这将是用户配置文件的属性)筛选该列表 你知道怎么做吗?我相信这是一个重复的问题 不管怎样,这里有mijn twee centen。 尝试在页面中添加任务web部件,并在此任务web部件中添加列“Department”,然后输入一些值,例如“IT”。然后将UserContextFilter web部件添加到同一页面。对其进行配置,以便将“部门”用户配置文件值发

如何根据当前用户的配置文件属性筛选Sharepoint(WSS 3.0)中的列表。例如,我有一个带有部门列的列表,我希望根据当前用户的部门(这将是用户配置文件的属性)筛选该列表


你知道怎么做吗?

我相信这是一个重复的问题

不管怎样,这里有mijn twee centen。
尝试在页面中添加任务web部件,并在此任务web部件中添加列“Department”,然后输入一些值,例如“IT”。然后将UserContextFilter web部件添加到同一页面。对其进行配置,以便将“部门”用户配置文件值发送到任务web部件。此时,当您尝试将usercontextfilter wp连接到tasks wp时,您将无法在下拉列表中看到“Department”。因为此下拉列表值是基于web部件的任务填充的。

您需要做的是首先获取用户的配置文件,查找属性,然后在CAML中使用该属性,如下所示:

UserProfile userProfile = ProfileLoader.GetProfileLoader().GetUserProfile();
string dept = userProfile["department"];    

// SPQuery CAML stuff here

格雷格的回答更恰当