<?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: Repeating Tables: Dynamic number of default rows.</title><link>https://www.infopathdev.com:443/forums/thread/37345.aspx</link><pubDate>Mon, 19 Jan 2009 16:46:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37345</guid><dc:creator>mocathe1st</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37345.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37345</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks for that.The restriction is pretty useful and I will be using that but what I was really looking for was a way of having the rows already exist in the form based on the number of time steps.&lt;/p&gt;&lt;p&gt;e.g. if I had 24 timesteps defined e.g. in /TimeSteps/@number then I would like to have 24 empty rows displaying when a (relevant) element with a repeating table is added to the form (e.g. from a choice of elements)&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;ve got the element choice nailed, but what I can&amp;#39;t figure out is how to add a default number of rows based on the timesteps. The only way I can come close to this is to set the minOccurs for the element in the schema to something but I can&amp;#39;t find a dynamic way of doing this. From what I can see you cannot use XPath in XSD schemas.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I hope that is clear. I think what I&amp;#39;m trying to do is possibly a little too complex, but I can&amp;#39;t think of a better way of doing it.&lt;/p&gt;&lt;p&gt;Thanks for your help and any ideas on how to do the above would be appreciated.&lt;/p&gt;&lt;p&gt;Malcolm &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Repeating Tables: Dynamic number of default rows.</title><link>https://www.infopathdev.com:443/forums/thread/37332.aspx</link><pubDate>Mon, 19 Jan 2009 14:03:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37332</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37332.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37332</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Here is the code,&lt;/p&gt;
&lt;p&gt;function msoxd_my_group2::OnBeforeChange(eventObj) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;var node = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:field2&amp;quot;).text;&lt;/p&gt;
&lt;p&gt;var groupNode = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:group1&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//repeating node is group2 &lt;/p&gt;
&lt;p&gt;var count = groupNode.selectNodes(&amp;quot;my:group2&amp;quot;).length; &lt;/p&gt;
&lt;p&gt;if(count &amp;gt; node) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;eventObj.ReturnStatus = false; &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;</description></item><item><title>Re: Repeating Tables: Dynamic number of default rows.</title><link>https://www.infopathdev.com:443/forums/thread/37331.aspx</link><pubDate>Mon, 19 Jan 2009 13:40:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37331</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37331.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37331</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can restrict the number rows in a repeating table using the following code in C#.&lt;/p&gt;
&lt;p&gt;public void group6_Changing(object sender, XmlChangingEventArgs e)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;XPathNavigator xn = this.MainDataSource.CreateNavigator(); XmlNamespaceManager xnsm = new XmlNamespaceManager(new NameTable()); xnsm.AddNamespace(&amp;quot;my&amp;quot;, &amp;quot;&amp;lt;Name space of the form&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;XPathNodeIterator nodeIterator = xn.Select(&amp;quot;/my:myFields/my:group5/my:group6&amp;quot;, xnsm);&lt;/p&gt;
&lt;p&gt;int count = 2;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;if(nodeIterator.Count &amp;gt; count)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp; e.CancelableArgs.Cancel = true;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; return;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here &amp;quot;/my:myFields/my:group5/my:group6&amp;quot; is the repeating table xpath. and&lt;/p&gt;
&lt;p&gt;Count is the number of rows you want to restrict after.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Note: After this it will show a error&amp;nbsp;message.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;</description></item><item><title>Repeating Tables: Dynamic number of default rows.</title><link>https://www.infopathdev.com:443/forums/thread/37322.aspx</link><pubDate>Mon, 19 Jan 2009 12:02:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37322</guid><dc:creator>mocathe1st</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37322.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37322</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;I&amp;#39;m currently working on an Infopath 2007 form based on my own XML Schema where some form elements have repeating tables which should have a default number of rows based on a value in another section of the form. I had thought that this may be possible using an XPath query in the default values properties for the Repeating Table, but cannot find a way of inserting the query.&lt;/p&gt;&lt;p&gt;My form is part of a solution for gathering data to be inserted into a simulation environment. What I&amp;#39;m trying to do here is to allow the user to insert the x number of timesteps in the simulation and then have x number of entries in the relevant repeating tables (one for each timestep).&lt;/p&gt;&lt;p&gt;I&amp;#39;m not very experienced with Infopath and can&amp;#39;t find a way of doing this. I suspect that I may need to write some JScript macros or something, but had hoped that there is an easier, XPath based, way of doing this.&lt;/p&gt;&lt;p&gt;Any help would be most appreciated.&lt;/p&gt;&lt;p&gt;Malcolm. &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>