Automatically generate new form in web browser - InfoPath Dev
in

InfoPath Dev

Automatically generate new form in web browser

Last post 04-28-2010 11:29 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-26-2010 12:01 AM

    • Jarecki
    • Not Ranked
      Male
    • Joined on 02-09-2010
    • Gliwice, Poland
    • Posts 25

    Automatically generate new form in web browser

    Hi, I'm searching for a solution to automatically generate new XML form (from template) and save it on SP site. The solution below runs Infopath locally installed and saves new form on disk. I would like to generate this form from web browser level (Infopath Forms Services) and on computer without Infopath application installed. Is it possible?

    I'm using the code below to generate new form:

    using Microsoft.Office.Interop.InfoPath;

    ApplicationClass infoPathClass = new ApplicationClass();

    XDocument xDoc = infoPathClass._Application_XDocuments.NewFromSolution(@"C:\template.xsn");

    xDoc.SaveAs(@"C:\Sample.xml");

    // code to upload form to SP site

    regards Jarek
  • 04-28-2010 11:29 AM In reply to

    Re: Automatically generate new form in web browser

    Hi Jarek,

    The above code requires full trust and won't work with browser forms since those forms are stored in SharePoint not on your C drive. You could use input parameters to create a form based on a button click. Then, you could add an open rule to automatically submit to SharePoint data connection and that would store a form for you in SharePoint without full trust. You'd have to add a close action to the open rule. I haven't tested this idea, but in theory it could work. Some hoops to leap through first though. Happy hopping!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.