Replicatin​g a repeating table / repeating sections - InfoPath Dev
in

InfoPath Dev

Replicatin​g a repeating table / repeating sections

Last post 09-18-2012 12:01 PM by Shrout1. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-18-2012 08:11 AM

    Replicatin​g a repeating table / repeating sections

    In an InfoPath form I have a repeating section; each repeating section houses a "line item". There is a "Sum" field that totals all the values in the line items.
     
    There are multiple "Sum" values on the form; I.E. there are multiple areas on the form that have multiple repeating sections. Modifications can be made to the line items within each summed section. This means that the "Sum" is really more like a "Running Total" which is modified through the course of the form.  Line items can be added and removed but all original information must be retained for tracking purposes. This means that the first "section of repeating sections" must replicate into the second "section of sections"... and then the second into the third and so on.
     
    So let's pretend:
     
    Initial form:
    Approved: $5
    Total: $5
    Line item 1: $3
    Line item 2: $2
     
    Modification 1:
    Authorized increase: $2
    Total: $7
    Line item 1: $3
    Line item 2: $3
    Line item 3: $1
     
    The initial values must exist within the form, the changed values must exist with the form. It all must show the correct running total somehow.
     
    I don't think this can be done without XSLT. Also, I don't think InfoPath form XSLT can be modified without pulling apart the form into its base components and putting it back together; I never had much luck with that. It seems like a for-each XSLT command would have to be run that replicates all the original nodes into new ones.
     
    I know that I could easily show the *same* data twice on the form, but I need to leave the original data alone for record keeping. I need to show a *copy* of the original data that can then be modified.
  • 09-18-2012 09:57 AM In reply to

    Re: Replicatin​g a repeating table / repeating sections

    Hello Shrout,

       qRules' CopyTable command can be used to copy entire repeating tables from one place to another and that might be able to accomplish what you're looking to do.  I'd imagine you'd have a data source like this:

     TopGroup

       - CurrentLineItems

            - LineItem (repeating)

       -ChangeRecord

            - ChangeRecordEntry (repeating)

                   - Items

                           - LineItem (repeating)

    Every time the form was submitted, you could use the Insert command to add a new row to the ChangeRecordEntry group, and then use CopyTable to copy the content of CurrentLineItems into /TopGroup/ChangeRecord/ChangeRecordEntry[last()]/Items

    Does that sound like something that might work for you?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-18-2012 12:01 PM In reply to

    Re: Replicatin​g a repeating table / repeating sections

    Sure does, though in my 2 years working where I am I have never seen my organization purchase third party software on the recommendation of a developer. So, would be awesome, if only!

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