How to store the total in the repeating table itself? - InfoPath Dev
in

InfoPath Dev

How to store the total in the repeating table itself?

Last post 05-08-2010 05:25 AM by haskbask. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-01-2010 10:35 PM

    How to store the total in the repeating table itself?

    I added a footer and used calculated fields and Sum() function to display the total. But I want to store it in the last row of the under laying xml data of the same table.
  • 05-05-2010 01:10 PM In reply to

    Re: How to store the total in the repeating table itself?

    OK here is the solution, i'll give you the way and you apply it to your form.

    Suppose you have 2 columns in your repeating table, column1 which is your goal to sum, and column2, you want to sum column2 and put the sum value below column2 but in the same repeating table, which means that you will have 2 fields in the same column, Drag a field and put it below column2 and double click it, and make its default value : sum(column2).

    Drag another field call it COUNT and put it outside the repeating table, double click it and give it a default value = count(repeating-table). so it counts number of rows for repeating table.

    Double click column1 (for testing only, this will be hidden) and put this formula as default value :

    count(../preceding-sibling::my:REPEATINGtable) + 1

     NOTE : only REPEATINGtable needs to be changed here, you have to write the name of your repeating table by yourself, don't look it up from the data source.

    now column1 will store the number of the row it's in.

    so for the sum field, double click it, click conditional formatting, make it : if column1 NOT equal COUNT then hide this control.

    it will work this way.

     

    Mohamed Derhalli ||| SharePoint Specialist ||| http://path2sharepoint.com
  • 05-08-2010 05:25 AM In reply to

    Re: How to store the total in the repeating table itself?

    Thanks you, it is working fine. But I changed the sum formula from sum(column2) to sum(../preceding-sibling::column2) + ../column2.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.