<?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: Insert Value into Expression Box inside Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/64747.aspx</link><pubDate>Wed, 02 Mar 2011 15:20:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64747</guid><dc:creator>wbeard52</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64747.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64747</wfw:commentRss><description>&lt;p&gt;I can go about and place values into a textbox now using the above code.&amp;nbsp; How would I &lt;u&gt;later pull&lt;/u&gt; out different values from the repeating section through code?&amp;nbsp; More specifically, I need to pull out the @Answer node for each repeating section.&amp;nbsp; Thanks for your help&lt;/p&gt;</description></item><item><title>Re: Insert Value into Expression Box inside Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/64704.aspx</link><pubDate>Tue, 01 Mar 2011 18:06:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64704</guid><dc:creator>wbeard52</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64704.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64704</wfw:commentRss><description>&lt;p&gt;Thanks Hilary for the quick response.&amp;nbsp; It is greatly appreciated.&amp;nbsp; I tried what you gave me to no success.&amp;nbsp; I thought it was quite strange so I converted the expression box to a textbox and ran the form again.&amp;nbsp; This time I provided a value in the textbox and the moment the textbox lost focus the value disappeared.&amp;nbsp; It did it for every section.&amp;nbsp; I pulled up the property for the text box and noticed the checkmark next to &amp;quot;Update this value when the result of the formula is recalculated&amp;quot;.&amp;nbsp; I deselected this feature and the code worked with your revised xPath.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I appreciate it.&lt;/p&gt;</description></item><item><title>Re: Insert Value into Expression Box inside Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/64698.aspx</link><pubDate>Tue, 01 Mar 2011 16:32:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64698</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64698.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64698</wfw:commentRss><description>&lt;p&gt;Try this instead:&lt;/p&gt;
&lt;p&gt;Qstn = group.CreateNavigator().SelectSingleNode(&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;@QuestionNumber&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;</description></item><item><title>Insert Value into Expression Box inside Repeating Table</title><link>https://www.infopathdev.com:443/forums/thread/64696.aspx</link><pubDate>Tue, 01 Mar 2011 15:56:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64696</guid><dc:creator>wbeard52</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64696.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64696</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found this code on this forum and it works great to get the number of repeating sections I need onto the form.&amp;nbsp; I am now trying to get a number into the @QuestionNumber node in each repeating section.&amp;nbsp; I can&amp;#39;t seem to figure it out.&amp;nbsp; Unfortunately, there are no errors given and the value is not inserted into the correct node.&amp;nbsp; The part after Dim Qstn is the code in question.&amp;nbsp; Thanks for helping me.&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;set the query fields&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xpath &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Tests/@NumberofQuestions&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; field &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataSources(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;Tests&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).CreateNavigator().SelectSingleNode(xpath, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;get the node you wish to have repeated&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;xpath = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Annual_Test_Results/d:AnnualTestAnswers&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;cast the field&amp;#39;s value to an int to know how many rows to add&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; rows &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = field.ValueAsInt&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;loop, cloning group&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;For&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i = 1 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;To&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; rows - 1&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newRow &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = group.Clone()&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;newRow.InsertAfter(group)&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Qstn &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator&lt;/p&gt;Qstn = group.CreateNavigator().SelectSingleNode(xpath &amp;amp; &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/@QuestionNumber&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;Qstn.SetValue(Convert.ToString(i))&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Next&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>