January 30, 2012

// // Leave a Comment

Promote Repeating table columns in infopath




Promoting all the contents of a repeating table is not possible, but I found a way by using a hidden field which will have all the repeating table values concatenated and we can promote this hidden field to SharePoint.

Follow the below steps to promote the columns of repeating table , For teaching point of view I have used two columns to promote , For your point of view you can implement using the below method.

Step 1:

        Create a repeating table with two columns
  1.          Name
  2.          Number
        Also create two Multi line text box’s to store the all the repeating table values by concatenating with semicolon (;)  
  1.      Sum of Name 
  2.      Sum of Number




Step 2:

Use the below code in fx of the sum of name

eval(eval(RepeatingGp, 'concat(substring(my:Name, 1, (current() = /my:myFields/my:FieldsGp/my:RepeatingGp) * string-length(my:Name)), substring(concat(my:Name, "; "), 1, (not(current() = /my:myFields/my:FieldsGp/my:RepeatingGp)) * string-length(concat(my:Name, "; "))), ";")'), "..")

Note:

Change the xml path of fields to your requirement, they are marked in red



Step 3:

Use the below code in fx of the sum of Number

eval(eval(RepeatingGp, 'concat(substring(my:Number, 1, (current() = /my:myFields/my:FieldsGp/my:RepeatingGp) * string-length(my:Number)), substring(concat(my:Number, "; "), 1, (not(current() = /my:myFields/my:FieldsGp/my:RepeatingGp)) * string-length(concat(my:Number, "; "))), ";")'), "..")



Note:

Change the xml path of fields to your requirement, they are marked in red



Step 4:

Promote the sum of name and sum of number fields, this way the repeating table columns can be promoted


Link to download of this InfoPath I have created.

http://www.sendspace.com/file/qzo4zk

0 comments:

Post a Comment