InfoPath form from an existing Data Source - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

InfoPath form from an existing Data Source

Last post 09-17-2007 08:16 AM by m181354. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 09-13-2007 11:07 AM

    InfoPath form from an existing Data Source

    I created an InfoPath form from an existing Data Source because I needed to have query capability. But now I need to add a control that is NOT bound to a data element. I just want to create the control like I did on a prior form when I did NOT create it from a Data Source. This is causing me multiple problems with my form. How can I do this?  Please let me know asap. I appreciate the help you have given me on previous questions!

    Filed under: , ,
  • 09-13-2007 12:12 PM In reply to

    Re: InfoPath form from an existing Data Source

    Since all most controls have to be bound to something in some data source, whenever you cannot or do not want to modify your main data source you answer is a secondary one.

    The best lowest-maintenance data source for these needs are from XML files. Simple create an empty XML file having as many fields as you need, then add it to your solution as a secondary DS and bind your controls to the fields in it.

    Of course, since the controls are bound to a secondary DS their values won't be saved in the main XML so you'll need to add rules or code to do something useful with those values.

    Hope this makes sense.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-13-2007 12:28 PM In reply to

    Re: InfoPath form from an existing Data Source

    Is that what happens when you create a form from a default template and not from a data source? 

    On my first form I created, I have a Main data source created from a default template(which was blank).  I created a data connection to an Access database but I am also able to create controls without the prompt to connect to a data source which is what I need to do now.

    On my second form,  I created the form from an existing data source so I could do a query but now I can not create a control with the data source prompt. 

    Do you have example of the XML file that I would need to create...and where do I store it? 

     

     

     

    Filed under: , ,
  • 09-13-2007 12:55 PM In reply to

    Re: InfoPath form from an existing Data Source

    Any XML file will do, such as:

    <myData>
      <dataField/>
    <myData>

    Just save it anywhere on your disk. Once you add a data source based on it, it will be included as part of the form template so you don't need to worry about storing it.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-13-2007 12:59 PM In reply to

    Re: InfoPath form from an existing Data Source

    This will allow me to add a text box control that I can add data to or use in a repeating table?  I also want to have another control sum the numbers in the column if I use it in a repeating table.

    Filed under: , ,
  • 09-13-2007 01:03 PM In reply to

    Re: InfoPath form from an existing Data Source

    Well, your XML will depend on how many controls you want to have and whether or not they repeat or not. If you want to have a repeating table bound to a secondary data source, create an XML which has an element that repeats:

    <myData>
      <row>
        <column1/>
        <column2/>
      </row>
      <row>
        <column1/>
        <column2/>
      </row>
    </myData>

    When InfoPath adds this XML as a data source, it will understand that row repeats and you will be able to insert it as a repeating table.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-13-2007 01:09 PM In reply to

    Re: InfoPath form from an existing Data Source

    When I created my first form,  I selected the default form and not an exsting data source,  does it use an XML file that Infopath builds for you as you create controls?

  • 09-13-2007 01:11 PM In reply to

    Re: InfoPath form from an existing Data Source

    Is there a way to switch my main data source to a secondary data source and still use the query feature?  That way I can add controls without having to build a XML file.

    Filed under: , ,
  • 09-13-2007 01:49 PM In reply to

    Re: InfoPath form from an existing Data Source

    Yes, there is... which InfoPath are you using, 2003 or 2007? You go Tools | Data Connections | Add, and then add a query connection. Then add a button to your form, add a Rule to the button to Query this connection.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-13-2007 06:08 PM In reply to

    Re: InfoPath form from an existing Data Source

    I am using InfoPath 2003.  Why is that when I started with a blank form(Main Submit) I could add controls without connecting them to a data source or I could use the secondary data connections I setup?

     Could I change how I have my current form (created from an existing data source) similiar to my first form?  The main data connection just connects to the form and I use secndary data sources when I need to read data in from a Access data base?

    I know I keep asking the sxame question but I am still trying to get my second form to behave like my first form even though I created the first from blank form and the second from a existing data source.

     

    Filed under: , ,
  • 09-13-2007 07:27 PM In reply to

    Re: InfoPath form from an existing Data Source

    All* controls have to be connected to something, either main data source or a secondary one. 

    The thing is, when you create a form from data source, your main data source will be typically locked and you won't be able to modify it.

    When you create a blank form the main data source is editable and you can add as many controls as you want.

    * Controls such as buttons, hyperlinks and expression boxes do not need to be connected to a data source.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-14-2007 04:32 AM In reply to

    Re: InfoPath form from an existing Data Source

    Can you change the MAIN data source once you have created the form?  I want to change my current form that was created from an existig data source to a blank form so I can add new controls.  I tried to start over and create the form again from a blank form but I could not the the query part to work.  I did what you said earler.  I noticed in the data source that the Data and Query schema is listed together under the same MAIN data source when I created the form from an existing data source. Is this what makes it  work.  I created 2 secondary data sources on the new form...one for the data and one for the query...but get the query to pull in the data.

    Filed under: , ,
  • 09-14-2007 08:15 AM In reply to

    Re: InfoPath form from an existing Data Source

    I posted several items on the forum and have been given helpful hints but I still don't have a solution.  I thought I would email you my question so I can put it all together on one spot and I will also post it.  I have an Infopath form that I created using an existing database, I did this because I wanted the query capability that was built in when you did it this way.  I need to add new controls that are not tied to a data source(the way you can do it if you create an Infopath form from a blank form where it is editable and you can create as many control as you want).  I need to add text boxes and repeating tables with the capability to add up the columns. I assume it is building the xml for you in that situation.
     
    Can I change the Main data source on a form after it has been created?  I would like to make the Main data source I have now a secondary data source but still keep the query capability.  I started to do this on a new form but I could not get the query to work.  Looks like when you create a form from an existing data source it combines the query and data into one source so the query can work.  I tried adding two data sources (one for data and one for query) to a new form but it did not work. 
     
    Any help is appreciated.  I am late on my ETC date and am willing to what it takes to get it done. I have not done any coding on the form and do not have much experience in doing it.  
  • 09-14-2007 09:33 AM In reply to

    Re: InfoPath form from an existing Data Source

    Hello,

    Modifying schema created when starting from a database or other data connection: You can do this. Just right-click on the very top node in the Data Source tree and click Add. I always suggest adding a group node that is something like "ViewLogic" or "FormData" and then put all your custom nodes in there. In that way you can add in any custom fields you want. The main data connection will only interact with the query and data fields.

     You can't move a main data source to a secondary. You either need to start over and copy/paste your view and then rebind the controls or just create your secondary data source as a query data source and go from there.

    To help more specifically, I would need a little more information about your scenario to understand what in your scenario requires the customization and main vs. secondary data source for your query data. With that I could provide best practices guidance.

     Thanks, Shiraz

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-15-2007 07:28 AM In reply to

    Re: InfoPath form from an existing Data Source

    Adding controls with the the "FormData" group node was exactly what I needed to do.  Thank you very much.

    One more question.  Can you add a repeating table from a Main sata source and also have columns in that table point to another data source (FormData)?  I tried this but the column from the "FormData" data source repeats the first enrty I put in.

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