Please HELP: Expression Box - Dynamic update - InfoPath Dev
in

InfoPath Dev

Please HELP: Expression Box - Dynamic update

Last post 10-12-2005 05:20 PM by franck. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-11-2005 08:07 AM

    Please HELP: Expression Box - Dynamic update

    I am working on a completed time with a repeating table.
    One of the options in the row is a drop-down box to select the apprpiate time (REG/OT/SICK/etc).

    I want to have a table outside of the repeating table that will total the time code values for Payroll so they don't have to do it manually.

    Basically, I need my expression box to update automatically. I want it to scan the repeating table for all instances of "REG", then for those rows, sum the totals in the "daily total" columns and then drop the end value into the "REG" expression box.

    Currently I can't even get teh "REG" expression box to even show the daily total for teh first row. Please help.

  • 10-11-2005 08:58 AM In reply to

    Re: Please HELP: Expression Box - Dynamic update

    Hi,

    Once flexible solution is to loop through your nodes by code and implement the business logic.

    Here is a basic sample to loop through your nodes to get you started:

    If you drop a repeating section on a blank form (with 2 textboxes field1 and
    field2), you will have the following schema:
    myFields
    group1
    group2
    field1
    field2

    You can loop through the node to retrieve the value stored in field1 for
    example:

    IXMLDOMNodeList oNodeList = thisXDocument.DOM.selectNodes(
    "my:myFields/my:group1/my:group2" );

    if (oNodeList.length>0)
    {
    foreach (IXMLDOMNode oN in oNodeList)
    {
    if( oN.nodeType == DOMNodeType.NODE_ELEMENT )
    {
    IXMLDOMNode oField = oN.selectSingleNode("my:field1");
    thisXDocument.UI.Alert(oField.text);
    }
    }
    }

    You need to check the value of the node linked to your drop-down to see if it is REG and add time in a variable outside the loop. Then you can display the final result in your table outside your repeating section.

    Hope that it helps.

    Regards,

    Franck Dauché
  • 10-12-2005 07:33 AM In reply to

    Re: Please HELP: Expression Box - Dynamic update

    Thannks Frank, I belive I got it working now with your help.
  • 10-12-2005 07:41 AM In reply to

    Re: Please HELP: Expression Box - Dynamic update

    Great! Glad I could help.
    Good luck with your InfoPath developments.

    Franck Dauché
  • 10-12-2005 05:02 PM In reply to

    Re: Please HELP: Expression Box - Dynamic update

    Franck - awesome help here and everywhere! Send me e-mail when you hit 100 for your free forum poster prize. It's red, right-bank, and over 18 years of age.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 10-12-2005 05:20 PM In reply to

    Re: Please HELP: Expression Box - Dynamic update

    I sure will Patrick! We will open it up together on the 21st floor...

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