Programmatically Repeat a Section or Table Based on Number of Characters in a Text Field - InfoPath Dev
in

InfoPath Dev

Programmatically Repeat a Section or Table Based on Number of Characters in a Text Field

Last post 11-12-2008 07:04 AM by jhvrealm. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-11-2008 08:35 AM

    Programmatically Repeat a Section or Table Based on Number of Characters in a Text Field

    Hello to InfoPathdev,

     I hope someone can assist in resolving this requirement. This is my first attempt at developing a form in InfoPath. Language is JS.

     My challenge:
    – Transfer text data entered by a user in the main view of an InfoPath form to a second view (export view) specifically configured for export purposes. Data exported to Excel must be done in such a way that the Excel can essentially import directly into a database.

    Requirements:
    – User text field in main view must allow for 600 characters max.
    – Text data must be transferred to the export view into a repeating component (section or table) that separates the text to a limit of 65 characters per repeating component.
       – This repeating component itself lies within a repeating table.

    Basically, how do I programmatically perform the same function as when a user enters the required text information, then presses the button to create a repeating table?

    Thank you for any help.

    Best Regards,

    jhvrealm

  • 11-11-2008 10:26 PM In reply to

    Re: Programmatically Repeat a Section or Table Based on Number of Characters in a Text Field

    I think you could probably do this without code too.

    You obviously would need one large text box and then a repeating node with 10 rows of 65 characters each.

    I would have an rowID field and then the small text field.

    So on the main view they add their text blob.

    When finished they select a button.

    You set field actions to populate the repeating nodes.

    Use substring function to take the first 65 characters and set them to the text where id = 1

    Then the next 65 to row 2 and etc.

    On the export view have a repeating table control that displays the 10 records and that will be what is exported to Excel. Whatever is visible on the view when export is selected.

    I would send the data straight from Infopath to the DB if possible and skip the Excel.  Web services are the way to go.

  • 11-12-2008 07:04 AM In reply to

    Re: Programmatically Repeat a Section or Table Based on Number of Characters in a Text Field

    Thank you for responding, Clay.

     I had done something similar to what you suggested already. It was a simple process to use the substring function to part out the total text entered into the user text field. The problem is the export into Excel requires manual manipulation in order to format in the proper structure allowing for import into our customer required MIL-STD-1388-2B database. I need to avoid any manual manipulation.

    What I am looking to accomplish is in conjunction with a text field being populated with 65 characters, a function would repeat the target table and continue populating in that manner until completed. If I had the code that calls that function when the user clicks the button to repeat a table or section, I could use that code to perform that function behind the scenes as the text is being interrogated for population into 65 character text fields in the export view.

    Does anybody know what that code is? Again, I am new at this and inherited a partial form from another newbie who was not aware of being able to determine what language would be behind the form itself. So as it is, the form relies on JS.

    Thanks again.

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