How to load xml into a Form - InfoPath Dev
in

InfoPath Dev

How to load xml into a Form

Last post 08-19-2009 12:24 AM by sekf01. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-14-2009 12:12 AM

    • sekf01
    • Not Ranked
    • Joined on 08-13-2009
    • Posts 2

    How to load xml into a Form

    I have a form (published to Sharepoint) that has a Submit button, which submits the XML data of the form to the database via a WCF web service (using the Submit action).

    I have a .NET web application that has a button that when clicked should allow the user to open the form and pre-load the form with the XML data previously saved to the database. I have some javascript in the aspx page that calls a window.open function passing in the sharepoint URL which should open the form in a browser window.

    I have search on the InfoPath Dev forums for an answer and I simply cannot find the answers to the questions I'm seeking: -

    1. How can I load the form with the XML data? A C# code snippet would be useful.

     2. Where should this code be placed a) in the aspx page of the .NET web application or B) in the codebehind of the InfoPath form using VSTA?

     Regards

    Sekf

  • 08-19-2009 12:04 AM In reply to

    Re: How to load xml into a Form

    Hi Sekf,

    Use the XsnLocation and XmlLocation query parameters to specify which form to open:

    Substitute your XsnLocation or XmlLocation on the server. The DocID=25 is an example of how you can pass a parameter to the form. The form would then need some OnLoad code to load the form but that's probably too much work for what you need. The second example is better. Just specify the name of the XML. In the exaple here, we are using this link on our SharePoint DataView webpart to open an XML based on the value of a column that the user would click on.

    Hope this helps a little....

    Patrick Halstead
    Project Manager at Qdabra
  • 08-19-2009 12:24 AM In reply to

    • sekf01
    • Not Ranked
    • Joined on 08-13-2009
    • Posts 2

    Re: How to load xml into a Form

    Thanks for your answer.

    Am I correct in saying that the XmlLocation query parameter would only work if XML file has been saved in a  SharePoint Form Library?

    The problem I have is I am not saving the form to SharePoint Form Library, but am saving the data to the SQL database. I do not want the user to save the form to the SharePoint Form Library as we want to keep the data in a separate database. We only want to use SharePoint as a document store, not data store.

    Thanks
    Sekf

     

     

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