sharepoint 中的调查结果
我如何获取已完成或未完成或未回复调查的用户列表。
所以我有一个调查,可以说“调查A”。 在这项调查中,我有一份必须填写调查的人员或团体的名单。 sharepoint 已经为我们提供了一份受访者名单,但我想列出一份尚未回复或未完成调查的人员名单。
我正在使用c#,谢谢..
how do i get a list of user that have completed or not completed or not responded to a survey.
so i have a survey, lets say "survey A". in this survey i have a list of people or groups that must fill the survey. sharepoint already gives us a list of respondents, but i want to make a list of people that have not responded or not completed the survey.
i'm using c#, thanks..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
评论(2)
想念有你2024-07-16 01:35:47
private DataTable GetUser()
{
//SPGroup User = null;
DataTable dt = new DataTable();
dt.Columns.Add("Survey Remeaning User");
DataTable dtuser = new DataTable();
dtuser.Columns.Add("Survey Completed User");
try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite objSubSite = new SPSite(SPContext.Current.Site.Url))
{
SPUserCollection userCollection = SPContext.Current.Web.Groups["Survey Members"].Users;
foreach (SPUser user in userCollection)
{
StringBuilder sb = new StringBuilder();
sb.Append("<Where>");
sb.Append("<Eq>");
sb.Append("<FieldRef Name='Author' />");
sb.Append("<Value Type='User'>" + user + "</Value>");
sb.Append("</Eq>");
sb.Append("</Where>");
// query.ViewFields = "<FieldRef Name='Author'/>";
SPQuery query = new SPQuery();
query.Query = sb.ToString();
using (SPWeb objWeb = objSubSite.OpenWeb())
{
int i = objWeb.Lists["SurveyList"].GetItems(query).Count;
if (i == 0)
{
dt.Rows.Add(user);
GvUser.DataSource = dt;
GvUser.DataBind();
}
//if (i == 1)
else
{
//DataTable dtuser = new DataTable();
//dt.Columns.Add("SurveyCompleted");
dtuser.Rows.Add(user);
GvComUser.DataSource = dtuser;
GvComUser.DataBind();
}
}
}
}
});
}
catch (Exception)
{
}
return dt;
}
您必须在用户和组中创建一个组,然后在其中添加用户。
然后你可以使用上面的功能并在页面加载中添加该功能....
我通过在网格视图中添加颜色来显示结果
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
假设您的调查被标记为非匿名,并且人们不能多次回答调查,您可以执行以下操作:
结果将是必须的人员列表回答调查,但尚未这样做。
Assuming that your survey is marked as non-anonymous, and that people can't answer the survey more than once, you can do the following:
The result will be the list of people that MUST answer the survey, but haven't done so yet.