Add Controls To InfoPath Form Programatically - InfoPath Dev
in

InfoPath Dev

Add Controls To InfoPath Form Programatically

Last post 10-10-2006 04:12 AM by Abhishek. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-25-2006 03:42 AM

    Add Controls To InfoPath Form Programatically

    Hi,

    I am looking to edit an infopath form programatically.

    What I want is to add text boxes to a form through code.

    I am using c# in Visual Studios and this is my preferred language but any language that achieves what I am looking for is fine.

    Any help would be greatly appreciated,

    Thanks
  • 09-25-2006 12:53 PM In reply to

    Re: Add Controls To InfoPath Form Programatically

    Could you tell us a little bit more about your situation? The easiest way that I can think of to accomplish this would be to create a repeating section with a text box in it, and then add instances of the group via code.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-25-2006 04:50 PM In reply to

    Re: Add Controls To InfoPath Form Programatically

    Sure,

    I have a datavase table such as the following

    Form, Measure

    X Measure 1
    X Measure 2
    X Measure 3
    Y Measure 1
    Y Measure 2

    What I want is to
    1. Create an infopath form for every form i.e. 2 here x abd y

    then

    2. Add a text box to that form for each measure, so form x would have 3 text boxes and form y would have 2 text boxes.

    Thanks
  • 10-09-2006 12:29 PM In reply to

    Re: Add Controls To InfoPath Form Programatically

    Welcome to our forum!

    The way to look at InfoPath is not programming against the view (which you cannot do) but by looking at the data and designing the view to take into account the possible shapes of the data. In this case, the measures would be a repeating section with a field and thus each one would show up in the series.

    In terms of creating a separate form for X and Y, you can programmatically do this when querying the database before opening InfoPath, or have InfoPath query for the XY list, then display a selection for the user to choose the item, then subsequently requery for the measures for that item.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 10-10-2006 01:57 AM In reply to

    Re: Add Controls To InfoPath Form Programatically

    Hi,

    Thanks for your reply,

    Could you possible give me a little more information with regard to the second part of your reply.

    Have InfoPath query for the XY list, then display a selection for the user to choose the item, then subsequently requery for the measures for that item.

    I am not sure exactl;y how to do this,

    thanks fot your help,
  • 10-10-2006 04:12 AM In reply to

    Re: Add Controls To InfoPath Form Programatically

    Hi eoinkennedy,

    What Shiraz says, is
    1)Have a view say "Forms" in ur InfoPath form.

    2)Retrieve the various forms from the database and display it in a Repeating Section.Keep a button in each row of the repeating section to display the measures for that form as follows...

    Forms Available
    X View Measures button
    Y View Measures button
    Z View Measures button

    3)On clicking the "View Measures button" for form "X",change the view to another view say "Measures" and query the database for all measures for Form "X" and display the Measures in a repeating section with a textbox for each measure in a row.

    Measures Available
    Measure1
    Measure2
    Measure3

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