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 / February 2008

Tip: Looking for answers? Try searching our database.

Loading Default Data into a Repeating Section or Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 25 Feb 2008 18:41 GMT
I would like to load multiple rows of default data from an xml file which has
been setup as a data source. I have created the repeating section and
assigned the fields in the section to the corresponding field in the
secondary data source. When the form is previewed only the first row of data
is displayed. If I insert a new row, i get the first record as default data
again. I will not always know how many rows will be in the default data that
i want to load.

I have been able to figure out how to read the data I need form the
secondary data source during the FormEvents_Loading event using the following
code:

           Dim rootDefaultData As XPathNavigator =
Me.DataSources("DefaultData").CreateNavigator()
           Dim nodeDefaultData As XPathNodeIterator =
rootDefaultData.Select("/Document/PPlan/PD/Doc", NamespaceManager)

           While nodeDefaultData.MoveNext()
               Dim Title As String =
nodeDefaultData.Current.SelectSingleNode("Title", NamespaceManager).Value
               Dim Description As String =
nodeDefaultData.Current.SelectSingleNode("Description",
NamespaceManager).Value

               MessageBox.Show(Title & " = " & Description)
           End While

I cannot figure out how to move those fields into the main data source or
the repeating section. The repeating section contains two text fields of the
same name. From what I have been able to figure out, the repeating section is
not available in this event so I will have to load the data into the main
data source.

Any help with this problem is appriecated.
Clay Fox - 25 Feb 2008 20:02 GMT
There are a couple examples of this on http://www.infopathdev.com if you
search.

You must iterate through the secondary and then insert a record for each
into your main DOM via code.

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> I would like to load multiple rows of default data from an xml file which has
> been setup as a data source. I have created the repeating section and
[quoted text clipped - 30 lines]
>
> Any help with this problem is appriecated.
Paul - 25 Feb 2008 20:50 GMT
Thanks for the reply.

Right now I am feeling really dense. I searched infoPathDev for examples
that would demonstrate how to insert records into my Main Data source using
code but have not been able to find any. As you can tell from my orignal
post, I am using Visual Basic with InfoPath 2007. Could you please point me
to the posts you referred to? Or at least provide the search terms you used
to find the posts.

Thanks,

> There are a couple examples of this on http://www.infopathdev.com if you
> search.
[quoted text clipped - 36 lines]
> >
> > Any help with this problem is appriecated.
Clay Fox - 26 Feb 2008 03:58 GMT
Hey Paul.
Here is one I was thinking of.
http://www.infopathdev.com/forums/p/5373/26723.aspx#26723

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Thanks for the reply.
>
[quoted text clipped - 47 lines]
> > >
> > > Any help with this problem is appriecated.
 
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.