2009-08-05 102 views
0

我正嘗試使用UserGroup.asmx Sharepoint Web服務來填充InfoPath 2007(2003兼容表單)中的下拉列表。我遵循這裏的說明:http://tim.bellette.net/2008/12/13/getting-sharepoint-users-in-infopath-2003。我在窗體的OnLoad事件中放置了下面的代碼,如果我設置了一個斷點,我可以看到GetUserCollectionFromGroupXML DOM包含正確的數據,但下拉列表仍然爲空。我不在這裏?使用SharePoint用戶填充InfoPath控件

 XmlDocument userCollectionFromGroup = new XmlDocument(); 
     userCollectionFromGroup.LoadXml(thisXDocument.DataObjects["GetUserCollectionFromGroup"].DOM.xml); 
     XPathNavigator siteUsers = userCollectionFromGroup.CreateNavigator(); 

     XmlNamespaceManager manager = new XmlNamespaceManager(siteUsers.NameTable); 
     manager.AddNamespace("dfs", "http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"); 
     manager.AddNamespace("tns", "http://schemas.microsoft.com/sharepoint/soap/directory/"); 

     // Query the user nodes 
     XPathNavigator allUsers = siteUsers.SelectSingleNode("/dfs:myFields/dfs:dataFields/tns:GetUserCollectionFromGroupResponse/tns:GetUserCollectionFromGroupResult/tns:GetUserCollectionFromGroup/tns:Users", manager); 

     // Load the users into the SiteUsersAndGroups connection 
     thisXDocument.DataObjects["GetUserCollectionFromGroupXML"].DOM.loadXML("<GetUserCollectionFromGroup>" + allUsers.OuterXml + "</GetUserCollectionFromGroup>"); 
+0

您是否設置了下拉列表來查看正確的數據連接? – 2009-10-07 11:34:49

回答

0

您是否嘗試過使用此代碼deduggin?

它可能是一個權限問題。我有類似的東西。