Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2007

Tip: Looking for answers? Try searching our database.

Reading Repeating Table Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kb at donovanhill - 31 Aug 2007 03:42 GMT
Hi,

I am using InfoPath 2007 with VB.net and would like to write all the field
values entered within a forms repeating table to a sharepoint list. Submit to
sharepoint is fine, I just need some sample code that loops through table
values, any help would be greatly appreciated.

Thanks
Signature

kb

K.Ramana Reddy(GGK Tech) - 31 Aug 2007 04:54 GMT
Hi,

Use below code.

//To get all nodes in a repeating table.
Dim NodeList = thisXDocument.DOM.selectNodes("Xpath of your repeating table
parent node")    
               
    //iterate through all nodes in repeating table.       
    for(var i = 0; i< NodeList.length; i++)
    {
        //if you want to do any thing here, you can write code        }

Signature

k.Ramana Reddy
http://www.GGKtech.com

> Hi,
>
[quoted text clipped - 4 lines]
>
> Thanks
kb at donovanhill - 04 Sep 2007 00:52 GMT
Hi,

Thanks for your reply, unfortunately 'thisXDocument.DOM.selectnodes' is now
legacy in InfoPath2007, so I could not get this to work, although your
suggestion prompted me to try other solutions, the vb.net code below works,
but may not be the best solution.

Public Sub CTRL5_5_Clicked(ByVal sender As Object, ByVal e As
ClickedEventArgs)
           
           Dim navigator As XPathNavigator = Me.CreateNavigator()
           Dim nodes As XPathNodeIterator =
navigator.Select("/my:myFields/my:group1/my:group2", NamespaceManager)
           Dim nodesNavigator As XPathNavigator = nodes.Current
           Dim NodeValue As String

           Dim nodestext As XPathNodeIterator =
nodesNavigator.SelectDescendants(XPathNodeType.Text, False)

           While nodestext.MoveNext()
               NodeValue = nodestext.Current.Value
                                   MessageBox.Show(nodestext.Current.Value)
                           End While

       End Sub
Signature

kb

> Hi,
>
[quoted text clipped - 17 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.