Repeating table calculation - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Repeating table calculation

Last post 04-25-2006 11:21 AM by lisaspencer. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-24-2006 02:49 PM

    Repeating table calculation

    I have a form that creates total mileage using a repeating table. The Miles control is populated from a SharePoint library when a company is chosen on the Infopath form. The first company works fine, but when I go to add another company, Miles duplicates the first company no matter what the company is. Here's the code for the Miles control:

    xdXDocument:GetDOM("Company Mileage")/dfs:myFields/dfs:dataFields/dfs:Company_Mileage/@Mileage[(../@Company_Name = xdXDocument:get-DOM()/my:Technician_Mileage/my:Mileage/my:Client_Name) and (xdXDocument:get-DOM()/my:Technician_Mileage/my:Mileage/my:Override_Mileage != string(true()))]

    Thanks in advance,
  • 04-24-2006 06:10 PM In reply to

    Re: Repeating table calculation

    You will need to use the current function for this. Check out this HowTo I recently wrote and I think it should be able to get you on the right track:

    http://www.infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-25-2006 08:03 AM In reply to

    Re: Repeating table calculation

    Matt,
    The drop down list works fine, it's the Miles control that is duplicating miles for the second company. I can send you the form if you'd like.
    Thanks,
  • 04-25-2006 10:30 AM In reply to

    Re: Repeating table calculation

    You will have to change your XPath to include use of the current() function. I'm not sure how your schema is laid out, but this might work:

    xdXDocument:GetDOM("Company Mileage")/dfs:myFields/dfs:dataFields/dfs:Company_Mileage/@Mileage[(../@Company_Name = current()/my:Mileage/my:Client_Name) and (current()/my:Mileage/my:Override_Mileage != string(true()))]

    Are you using rules on the drop-down or a default value formula to populate the miles field? Here are some references for the current() function:

    http://www.google.com/search?q=xsl+current+function
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-25-2006 11:21 AM In reply to

    Re: Repeating table calculation

    We are using rules to populate the miles field. What is a Node-test expected error?
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.