<?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: Unable to loop through a data list.</title><link>https://www.infopathdev.com:443/forums/thread/6770.aspx</link><pubDate>Mon, 02 May 2005 20:37:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6770</guid><dc:creator>RichardM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6770.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6770</wfw:commentRss><description>Agni,&lt;br /&gt;&lt;br /&gt;EXCELLENT!&lt;br /&gt;&lt;br /&gt;Your other reference suggestion worked exactly like I wanted it to.&lt;br /&gt;&lt;br /&gt;Thanks for your assistance.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Richard</description></item><item><title>Re: Unable to loop through a data list.</title><link>https://www.infopathdev.com:443/forums/thread/6769.aspx</link><pubDate>Sat, 30 Apr 2005 15:10:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6769</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6769.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6769</wfw:commentRss><description>Hi Richard, Welcome to the board.&lt;br /&gt;You made a small mistake in the following statement&lt;br /&gt;total = dom.documentElement.selectSingleNode("dfs:dataFields/d:dtOrderTracking&lt;i&gt;/@OrderVal").value; //it is the &lt;i&gt; in this line that causes the error&lt;br /&gt;&lt;br /&gt;You are placing  "i" in between the string as part of the string, but value of "i" should go in place of "i". So your statement should be &lt;br /&gt;&lt;br /&gt;total = dom.documentElement.selectSingleNode("dfs:dataFields/d:dtOrderTracking["+i+"]/@OrderVal").value;&lt;br /&gt;&lt;br /&gt;But there is another best way that you can follow here, you already getting  reference to the "d:dtOrderTracking" nodes in &lt;br /&gt;"var nodeList = dom.selectNodes("/dfs:myFields/dfs:dataFields/d:dtOrderTracking");" &lt;br /&gt;&lt;br /&gt;you can use this reference instead of selecting the whole node again. so your for loop can be  &lt;br /&gt;for (var i=1; i&amp;lt;listLength; i++) {&lt;br /&gt;total = nodeList&lt;i&gt;.selectSingleNode("@OrderVal").value; &lt;br /&gt;XDocument.UI.Alert(total); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;br /&gt;Agni&lt;br /&gt;InfoPathDev India</description></item><item><title>Unable to loop through a data list.</title><link>https://www.infopathdev.com:443/forums/thread/4640.aspx</link><pubDate>Fri, 29 Apr 2005 16:46:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4640</guid><dc:creator>RichardM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4640.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4640</wfw:commentRss><description>I am a Lotus Notes developer trying to recreate database functionality in InfoPath.  Who said that you can not teach an old dog new tricks?&lt;br /&gt;&lt;br /&gt;The Lotus Notes database is used to track sales orders and I created several scripts to parse through the records to calculate many different values.  These scripts take the resulting calculations and create a report record for management purposes. I have replicated the same tracking form layout in InfoPath and I save the form data to a SQL database.  This all works great and I can retrieve the data by using various queries and use different views to display the results.&lt;br /&gt;&lt;br /&gt;The problem is that I am unable to parse through the data and perform the calculations so a report can be created for management.  I have found many examples on how to do this but they do not work for me. &lt;br /&gt;&lt;br /&gt;The process that I am going through to create the report:&lt;br /&gt;Step 1: Open form to a basic menu view that allows for the selection of the quarter and year &lt;br /&gt;Step 2: Query the adapter and retrieve the SQL Query command&lt;br /&gt;Step 3: Modify the SQL Query command based upon the selection made in step 1&lt;br /&gt;Step 4: Query the adapter using the new SQL Query command&lt;br /&gt;Step 5: Determine how many items are in the data list&lt;br /&gt;Step 6: Loop through the data list and calculate the different fields as required.&lt;br /&gt;Step 7: Enter these calculations into a report view.&lt;br /&gt;&lt;br /&gt;This all sounds very simple but I can not get past step 6.  &lt;br /&gt;&lt;br /&gt;Using the below code causes a runtime error stating that “Object required”:&lt;br /&gt;&lt;br /&gt;var nodeList = dom.selectNodes("/dfs:myFields/dfs:dataFields/d:dtOrderTracking");&lt;br /&gt;var listLength = nodeList.length;&lt;br /&gt;var total = 0;&lt;br /&gt;&lt;br /&gt;for (var i=1; i&amp;lt;listLength; i++) {&lt;br /&gt;total = dom.documentElement.selectSingleNode("dfs:dataFields/d:dtOrderTracking&lt;i&gt;/@OrderVal").value;  //it is the &lt;i&gt; in this line that causes the error&lt;br /&gt;XDocument.UI.Alert(total);  // used to display the value of the field&lt;br /&gt;}&lt;br /&gt;	&lt;br /&gt;If I modify the code by replacing the &lt;i&gt; with a number it works OK.&lt;br /&gt;&lt;br /&gt;var nodeList = dom.selectNodes("/dfs:myFields/dfs:dataFields/d:dtOrderTracking");&lt;br /&gt;var listLength = nodeList.length;&lt;br /&gt;var total = 0;&lt;br /&gt;&lt;br /&gt;for (var i=1; i&amp;lt;listLength; i++) {&lt;br /&gt;total = dom.documentElement.selectSingleNode("dfs:dataFields/d:dtOrderTracking[1]/@OrderVal").value;  //returns the value of the first entry&lt;br /&gt;XDocument.UI.Alert(total);  // used to display the value of the field&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I know that I am looping through the list because I can place a UI.Alert looking a i and it increments.&lt;br /&gt;&lt;br /&gt;Any assistance would really be appreciated.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Richard</description></item></channel></rss>