Copying sek. datasets to primary datasets - InfoPath Dev
in

InfoPath Dev

Copying sek. datasets to primary datasets

Last post 05-25-2006 02:41 PM by seattle67. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-10-2006 08:47 AM

    Copying sek. datasets to primary datasets

    Hi,

    I look for a solution to copy data which are in an xml-File to a primary table.

    I did like this:

    I implemented a button to import data from an XML File into InfoPath
    After the import the data are all in repeatable table but with the secundary data source. I did not store the data in the formular because the input file will change. After the import I would like to copy all the imported date to a repeatable table in the primary data storage to store them and to modify them per hand in the formular.

    Can anybody help me?
  • 05-11-2006 06:01 AM In reply to

    Re: Copying sek. datasets to primary datasets

    Hello,
    What do you mean by Primary table? Is it a table in a SQL database or the Main datasource? Something else? Please give more details. Also what does formular mean?

    Thanks
  • 05-12-2006 01:21 AM In reply to

    Re: Copying sek. datasets to primary datasets

    Hi,
    thank you very much for your questions I try to explain it in a different way.

    I want to give the users of the form the possiblity to import a xml file into the form. Therefore I created a new data connection for receiving data from a xml file e.g. test.xml. This file is in a special directory and has a defined structur but each user wants to import in his form different data therefore he has to copy his "own" test.xml in the directory.

    see example for the file structure

    <?xml version="1.0" encoding="utf-8"?>
    <cart IF_VERSION="2.3"
    CREATION_DATE="11/03/2006"
    ORDER_NO="ORD-1">
    <delivery DATE="01/08/2006"
    PARTIAL_SHIPMENT_POSSIBLE="no"
    COUNTRY_CODE=""/>
    <item LINE_ITEMNUMBER="1"
    PRODUCT_ID="00123"
    QUANTITY="10"
    CUSTOMER_PRODUCT_PRICE="99.90">
    <description LANGUAGE="1">Part 1</description>
    <list ID="1" LISTPRICE="109.00" PRICEUNIT="1" PRICE_QUANTITY_SCALE="1"/>
    </item>
    <item LINE_ITEMNUMBER="2"
    PRODUCT_ID="00124"
    QUANTITY="1"
    CUSTOMER_PRODUCT_PRICE="300.00">
    <description LANGUAGE="1">Part 2</description>
    <list ID="1" LISTPRICE="310.00" PRICEUNIT="1" PRICE_QUANTITY_SCALE="1"/>
    </item>
    <item LINE_ITEMNUMBER="3"
    PRODUCT_ID="00999"
    QUANTITY="1"
    CUSTOMER_PRODUCT_PRICE="100.20">
    <description LANGUAGE="1">Part 3</description>
    <list ID="1" LISTPRICE="110.50" PRICEUNIT="1" PRICE_QUANTITY_SCALE="1"/>
    </item>
    </cart>


    For importing the file in a form I created a button which opens the data connection. After pressing the button the data are in the secundary data structure "test".

    The problem is that if the user closes the form the data are not stored in the form. The problem is that the next user who creates a new form imports the file test.xml with other data. Therefor I have to store the data from the xml File in the main (primary) data store of the form. I think I have to create a new structure in the form(e.g. a repeatable table called "importtable") and I have to copy the imported data in this table. But it is not possible to do this by assigning the secundary values to the values in the table "importtable" in the form because in this case I get only the last row (the last data) of the xml File in the table. My personal point of view is that I have to write a script which inserts the rows of the secundary data structure to the repeatable table including inserting new rows in my table "importtable". But I do not know how to do this or if there is another way to store the imported xml data in the form.

    Many thanks for help.
  • 05-22-2006 12:12 AM In reply to

    Re: Copying sek. datasets to primary datasets

    Hello,
    You can use Custom merge in order to merge data of all the XMLs into one. To do Custom merge take a look at Meeting Agenda sample solution which merges Issue tracking forms. You can also refer Pages from 47 to 52 in book called “Developing solutions with Microsoft InfoPath”.

    Hope this helps!
  • 05-25-2006 02:41 PM In reply to

    Re: Copying sek. datasets to primary datasets

    Hi thank you but how can I merge a secondary data source to a main data source? I think vasanthaprabu describes the same problem and he has no solution, too. Mybe someone can help me with an example.
    Thank you in advance.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.