I had a task to iterate through the repeater table of InfoPath 2007 form and get all the values entered by user on submit.
Here is a vb.net code
Imports Microsoft.Office.InfoPath
'' ********** Upload multiple attachments **************
Public Sub btnUploadAllAttachments_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
Dim xPathNavigator As XPathNavigator = MainDataSource.CreateNavigator()
Dim rows As XPathNodeIterator = xPathNavigator.Select("/my:ShowCauseForm/my:ShowCauseDetails/my:AttchmentsTable/my:AttachmentRow", NamespaceManager)
While rows.MoveNext()
Upload(rows.Current.SelectSingleNode("my:Attachment", NamespaceManager).Value, "/my:ShowCauseForm/my:ShowCauseDetails/my:HyperLinkSection/my:AttachmentUrl", "Attachment")
End While
Windows.Forms.MessageBox.Show("All attachments uploaded successfully", "Attachments Upload", MessageBoxButtons.OK)
End Sub
No comments:
Post a Comment