repeating section...one field needed??? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

repeating section...one field needed???

Last post 01-19-2010 07:42 AM by golden_shiner. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-15-2010 09:03 AM

    repeating section...one field needed???

    hello all!!

     I have a repeating section such as:

     SPECIES_ID
     count
     length
     weight
     notes
    I need to only access SPECIES_ID value for each repeating section and store it into an array. I am working in C#, and I need to do this before saving the infopath form.

    I have tried using: 
     
    XmlDocument doc = new XmlDocument();            
                   doc.Load(NFile);   // NFile contains the file Name
                   XmlElement root = doc.DocumentElement;
                   XmlNodeList TestNodeList;  
                   TestNodeList = root.SelectNodes("/my:myFFIM_base_table/my:Species_Records/my:SpeciesGroup/my:SPECIES_ID", NamespaceManager);
    but to no success. Can anyone point me into the right direction as to how to do this? Thank You!!

  • 01-15-2010 09:58 AM In reply to

    Re: repeating section...one field needed???

     Does following that code with this not work?:

    string[] ids = new string[TestNodeList.Count];
    int i = 0;
    foreach(XPathNavigator speciesId in TestNodeList)
    {
         ids[i] = speciesId.Value;
         i++;
    }

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-15-2010 10:16 AM In reply to

    Re: repeating section...one field needed???

    well, the thing is, the application breaks when it hits

    doc.Load(NFile);   // NFile contains the file Name

    I think it is beacause NFile only contains the file name not a path, as the xml file is not saved yet. so I don't know if there is any other way to acces the SPECIES_ID field, or maybe another way to point to this 'unsaved' xml file...any help is appreciated

  • 01-15-2010 07:10 PM In reply to

    Re: repeating section...one field needed???

    Well, I'm not sure how you expect to access data from a file that doesn't exist, which is what your code is apparently trying to do.  Could you give a bit more detail about what you're trying to do?
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-19-2010 07:42 AM In reply to

    Re: repeating section...one field needed???

    I apologize for not being very clear. Basically,  after the user fills out this form, and before they save it, they click on "check" button, which trigers an event and goes through some of the fields for make comparisons. and that is when I need to access that SPECIES_ID field from the repeating sections and have not been able to. Thanks again for any help.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.