Launching InfoPath from Web Application - InfoPath Dev
in

InfoPath Dev

Launching InfoPath from Web Application

Last post 06-16-2005 03:37 PM by Shanthi Reddy. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 06-07-2005 09:42 AM

    Launching InfoPath from Web Application

    Hi guys -

    I'm very new to Infopath and I'm trying to crank out a prototype for us to make a decision to use Infopath or not. We need to launch infopath files from our existing web application. I need quick advice on two things:

    1. how to launch infopath on the client's machine from within our webapp. I don't really have to launch infopath, I guess the user needs to be prompted to do so. It is fine if the user is prompted with an open/save option that does the actual launching of infopath. We do this with word, but not with infopath currently...

    2. how do I pass some key values to the infopath document to use in the on_load event of my form for prepopulation? (i.e. the application user will be viewing a certain patient's chart and the form needs to prepopulate with the patient's data) I have the form prepopulating from the on_load with hardcoded values, but now I need to actually get these two key values from our web application.

    Thanks!
    Donna
  • 06-07-2005 04:05 PM In reply to

    Re: Launching InfoPath from Web Application

    Hi,
    1.
    a. You need to get the xml from the source and throw as an attachment to the user, then the user will be prompted to either save or open the form. This works if you have an xml ready to throw.
    b. If you donot have any xml you want to open the form then you need to redirect your page to the location where your temkplate.xsn is located.

    2. You can set default values if you are using solution "a" because what you have in an xml file, so you can edit the xml file and throw it.



    Agni
    InfoPathDev India
  • 06-08-2005 12:53 AM In reply to

    Re: Launching InfoPath from Web Application

    you can use xdlaunch to launch infopath and pass parameters es part of the xml file or via cmd line (i believe)

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 06-08-2005 08:20 AM In reply to

    Re: Launching InfoPath from Web Application

    Thanks for the feedback.

    Patrick - I googled xdlaunch and did not get much back - I've never heard of it - can you point me towards some documentation/examples?

    Agni - I was trying yesterday to 'throw' the xml as you said. I was not 100% sure this would work, but since you've suggested it too I will continue to work on getting this working.
    Thanks!

    Donna
  • 06-09-2005 09:14 AM In reply to

    Re: Launching InfoPath from Web Application

    Okay I did get infopath to launch on the client machine with a link to the xsn. But as this is not using the xml, but the template I'm not sure I can prepopulate it by passing in a parm. I'm sure there is a solution that I'm just not getting to in my brain. :)

    I figured I could create a form on the server and actually have the form open on the users PC with my prepopulated values already in the xml. Or i could have my webservice on load look in the db maybe ...

    Is there other ideas I'm ignoring? Maybe a cookie? I'm not too familiar with those.

    Advice would be great ...

    Thanks!
  • 06-09-2005 02:00 PM In reply to

    Re: Launching InfoPath from Web Application

    Hi this code might help you in launching an xml file from your webserver, or probably you can write similar code

    Response.AddHeader("Content-Disposition", "attachment; filename=filename.xml");
    Response.AddHeader("Content-Length", xmlstring);
    Response.ContentType = "text/xml";
    Response.Write(content);

    Agni
    InfoPathDev India
  • 06-10-2005 07:10 AM In reply to

    Re: Launching InfoPath from Web Application

    I've been working on a way to create a form on the server from a template and i've got this working:

    Dim ipApp As Microsoft.Office.Interop.InfoPath.ApplicationClass
    ipApp = New Microsoft.Office.Interop.InfoPath.ApplicationClass

    newXMLForm = ipApp.XDocuments.NewFromSolution("D:\Inetpub\wwwroot\MMDS\OALPrescriptionForm.xsn")
    ipApp.Quit()

    newXMLForm.SaveAs("D:\newForm.xml")

    However, is there a way to do this without opening infopath on the server? can i use the api's without launching the UI?

    Thanks!

    Donna
  • 06-12-2005 06:40 AM In reply to

    Re: Launching InfoPath from Web Application

    The Only way that i can think of is have the template.xml file of OALPrescriptionForm.xsn as a base file and make changes to it as required before you save it as newForm.xml. This way InfoPath will not open, and these new files are InfoPath files and when the user tries to open them they will open using InfoPath

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 06-13-2005 01:09 PM In reply to

    Re: Launching InfoPath from Web Application

    Shanthi -

    Thanks so much for your reply - let me make sure I understand.

    Do you mean instead of using NewFromSolution method, which requires I open infopath on the server, I could basically make a copy of the template.xml that belongs to the template (xsn) I want - and just edit that copy with the prepopulated data. This makes sense (I think) because the template.xml file is the same as the newform.xml would be when created from the NewFromSolution. :) That is I think a grand idea ... I will look into it further. Let me know if I misunderstood.

    Thanks!

    Donna
  • 06-16-2005 03:37 PM In reply to

    Re: Launching InfoPath from Web Application

    No you haven't misunderstood. That is what i meant. If you want pre-create forms for your team to use then this is a good way of doing it and you can also set some base data for them.

    You can use either template.xml or a new form created using the OALPrescriptionForm.xsn as you base from which you create the new forms.

    Shanthi
    InfoPathDev India
    Shanthi Reddy
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.