Open saved form or create new from template - InfoPath Dev
in

InfoPath Dev

Open saved form or create new from template

Last post 01-19-2007 07:03 AM by olofsu. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-15-2007 05:08 AM

    • olofsu
    • Not Ranked
    • Joined on 01-15-2007
    • Sweden
    • Posts 2

    Open saved form or create new from template

    Hi,

    I have created a web part to render a form. I use the same technique as described in the following link:
    http://jopx.blogspot.com/2006/09/rendering-infopath-2007-form-in-web.html

    The form template (XSN file) is uploaded to a Sharepoint document library with
    XsnLocationhttp://thehost/Form_Application/Forms/template.xsn

    When a user opens the form corresponding form data will be saved in
    XmlLocationhttp://thehost/Form_Application/username.xml

    When a user opens the form the first time I would like a new form to be created from the form template based on the XsnLocation.

    When a user opens the form the next time I would like the form to be opened based on the data stored in the XmlLocation.

    It is not possible to specify both locations (XmlLocation and XsnLocation) in the XmlFormView control simultaneously since they are mutually exclusive.

    How should I solve this problem?
    Are there better ways to prepopulate forms?

    Thanks!
  • 01-17-2007 12:29 PM In reply to

    Re: Open saved form or create new from template

    What you're trying to do is set the Save as location. You can do this in the form itself through code. Look for that as a property you can set. You can set the filename too.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-19-2007 07:03 AM In reply to

    • olofsu
    • Not Ranked
    • Joined on 01-15-2007
    • Sweden
    • Posts 2

    Re: Open saved form or create new from template

    I already use the Save location today. I'll try to explain my problem with an example.

    When users Neil and Phil opens the form the first time a new form based on the form template (defined by XsnLocation) is opened:
    http://thehost/Form_Application/Forms/template.xsn

    When user Phil submits the new form the data is stored in Save location:
    http://thehost/Form_Application/Phil.xml

    When user Neil submits the new form the data is stored in Save location:
    http://thehost/Form_Application/Neil.xml

    When Phil or Neil opens the form the second time a form with
    the data from the xml file should be opened. This can be done by simply opening the xml file with the path specified by XmlLocation.

    It would also be possible to open the form specified by XsnLocation and use a data connection to retrieve data from SharePoint columns when the form is opened. When Phil/Neil submits the form data the existing xml file be overwritten with the old/modified data. But since the form contains a file attachement control which cannot be mapped to a SharePoint field, this is not a possible solution.

    Thus, the web part used to display the form must provide
    XsnLocation="http://thehost/Form_Application/Forms/template.xsn"
    XsnLocation=""
    or
    XsnLocation=""
    XsnLocation="http://thehost/Form_Application/Phil.xml"
    depending on if there is an xml file or not.

    My original question is if there is a better or more simple way to do this. Thus, if there is a way to let the web part used to display the form to always provide the settings
    XsnLocation="http://thehost/Form_Application/Forms/template.xsn"
    XsnLocation=""
    and let InfoPath handle the population of data stored in the SharePoint library.

    Any suggestions?

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