Infopath: Iterating through a repeating table that is bound to a Sharepoint-List

12 11 2008 Software-Development
this is how you do it with Infopath 2007 and Microsoft Office Server 2007 (MOSS2007) or Windows Sharepoint Server 3.0. It's not valid for Infopath 2003. I've added comments to the code, so if you are a little familiar with c# it should be quite self explanatory. If you have questions just ask.

public void test1()
      {
          //We're creating a XpathNodeIterator here. Each Node in the XpathNavigator-Collection nodes1 represents one row of the sharepoint list
          XPathNodeIterator nodes1 = DataSources["string-name of the sharepointlist-data-connection";, NamespaceManager);         


          foreach (XPathNavigator n in nodes1)       
	  {   	// The field/column of each single row of the list you want is represented as an attribute
    	  MessageBox.Show(n.GetAttribute("field-/column-name", nodes1.Current.NamespaceURI));
	  }

Replace the Messagebox.Show with any action that you need to.


Trackbacks


No Trackbacks

Comments

Display comments as (Linear | Threaded)
No comments

Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA




cronjob