<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: how to copy secondary data into multiple repeating tables in main ds?</title><link>https://www.infopathdev.com:443/forums/thread/41215.aspx</link><pubDate>Fri, 01 May 2009 16:51:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41215</guid><dc:creator>rippedX</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41215.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=41215</wfw:commentRss><description>Thanks for your response Patrick, I appreciate it! However, I was already referred to qRules and tried it, but found it does not fit my needs as it will not work in the on load event.

Do you mean pass in the groups/fields in that I want to copy to? So I don&amp;#39;t need to create them on the fly, just retrieve them from the main data source?</description></item><item><title>Re: how to copy secondary data into multiple repeating tables in main ds?</title><link>https://www.infopathdev.com:443/forums/thread/41202.aspx</link><pubDate>Fri, 01 May 2009 07:21:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41202</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41202.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=41202</wfw:commentRss><description>&lt;p&gt;Hey xRipped and welcome!&lt;/p&gt;
&lt;p&gt;We created qRules to help with these kind of issues. It&amp;#39;s qRules and supports copying from external tables to internal ones *without code*. Simpler, less cost to you. Voila! &lt;/p&gt;
&lt;p&gt;To fix your code will require someone debugging it with the form. It&amp;#39;ll take time. Maybe you can figure it out, but if you can&amp;#39;t you could just buy a Qdabra.com support pack (under products) and get an hour or two of help. It&amp;#39;ll cost money, but we can&amp;#39;t give hours to everyone in the forum since we have lots of posts these days and we&amp;#39;d go out of business... hope you understand. You probably have some simple issue like the main node isn&amp;#39;t being selected or something. &lt;/p&gt;
&lt;p&gt;By the way, you shouldn&amp;#39;t be putting the group and field in the AddItem routine. Pass those in from above. &lt;/p&gt;
&lt;p&gt;Bottom line though: qRules enables this without code. And, it&amp;#39;s free with documentation and videos on how to do that. Have fun.&lt;/p&gt;</description></item><item><title>how to copy secondary data into multiple repeating tables in main ds?</title><link>https://www.infopathdev.com:443/forums/thread/41190.aspx</link><pubDate>Thu, 30 Apr 2009 21:45:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41190</guid><dc:creator>rippedX</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41190.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=41190</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;

I have a browser form which receives data from a sharepoint list. I am copying that data into a repeating table in the main ds. I need it copied into a total of 3 repeating tables (identical tables), and can&amp;#39;t seem to do it. &lt;br /&gt;&lt;br /&gt;

This is from a tutorial. I tried just making copies of the code with the correct names of the other tables, but an exception is thrown on this line: doc.AppendChild(group); that says there is already a document element.&lt;br /&gt;&lt;br /&gt;

My additional tables are (2 columns/2 fields):&lt;br /&gt;&lt;br /&gt;

/my:COBInquiry/my:group3/my:group4/my:field3
/my:COBInquiry/my:group3/my:group4/my:field4&lt;br /&gt;&lt;br /&gt;

/my:COBInquiry/my:group5/my:group6/my:field5
/my:COBInquiry/my:group5/my:group6/my:field6&lt;br /&gt;&lt;br /&gt;

Repeating table structure should end up being (this is simply InnerXml):&lt;br /&gt;&lt;br /&gt;


  AACSB 
  AACSB 
  

&lt;br /&gt;&lt;br /&gt;


  AACSB 
  AACSB 
  

&lt;br /&gt;&lt;br /&gt;


  AACSB 
  AACSB 
  

&lt;br /&gt;&lt;br /&gt;

Here is my code:&lt;br /&gt;&lt;br /&gt;

public void FormEvents_Loading(object sender, LoadingEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            XPathNavigator secDSNav = DataSources[&amp;quot;ReferredBy&amp;quot;].CreateNavigator();&lt;br /&gt;&lt;br /&gt;

            // Retrieve the rows of the secondary data source&lt;br /&gt;
            // /dfs:myFields/dfs:dataFields/dfs:COBInquiryDataSource&lt;br /&gt;
            XPathNodeIterator rows = secDSNav.Select(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:COBInquiryDataSource&amp;quot;, NamespaceManager);&lt;br /&gt;&lt;br /&gt;

            // Loop through the rows of the secondary data source and fill the repeating table&lt;br /&gt;
            while (rows.MoveNext())&lt;br /&gt;
            {&lt;br /&gt;
                string title = rows.Current.SelectSingleNode(&amp;quot;@Title&amp;quot;, NamespaceManager).Value;&lt;br /&gt;
                string displayname = rows.Current.SelectSingleNode(&amp;quot;@DisplayName&amp;quot;, NamespaceManager).Value;&lt;br /&gt;&lt;br /&gt;

                // Add the item to the repeating table&lt;br /&gt;
                AddItem(title, displayname);&lt;br /&gt;
            }&lt;br /&gt;&lt;br /&gt;

            // Remove the first empty item from the repeating table&lt;br /&gt;
            DeleteFirstEmptyItem();&lt;br /&gt;
        }&lt;br /&gt;&lt;br /&gt;

        private void AddItem(string title, string displayname)&lt;br /&gt;
        {&lt;br /&gt;
            XmlDocument doc = new XmlDocument();&lt;br /&gt;
            XmlNode group = doc.CreateElement(&amp;quot;group2&amp;quot;, NamespaceManager.LookupNamespace(&amp;quot;my&amp;quot;));&lt;br /&gt;&lt;br /&gt;

            XmlNode field = doc.CreateElement(&amp;quot;field1&amp;quot;, NamespaceManager.LookupNamespace(&amp;quot;my&amp;quot;));&lt;br /&gt;&lt;br /&gt;

            XmlNode node = group.AppendChild(field);&lt;br /&gt;&lt;br /&gt;

            node.InnerText = title;&lt;br /&gt;&lt;br /&gt;

            field = doc.CreateElement(&amp;quot;field2&amp;quot;, NamespaceManager.LookupNamespace(&amp;quot;my&amp;quot;));&lt;br /&gt;&lt;br /&gt;

            node = group.AppendChild(field);&lt;br /&gt;&lt;br /&gt;

            node.InnerText = displayname;&lt;br /&gt;&lt;br /&gt;

            doc.AppendChild(group);&lt;br /&gt;&lt;br /&gt;

            MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;/my:COBInquiry/my:group1&amp;quot;, NamespaceManager).AppendChild(doc.DocumentElement.CreateNavigator());&lt;br /&gt;
        }&lt;br /&gt;&lt;br /&gt;

The end result I want is all the data in the splist split among all three tables...So if the splist has 32 entries, 10 would be in one table, 11 in another, and 11 in the last. If anyone also knows how to do this, programmatically in code, I would appreciate it a lot!</description></item></channel></rss>