Loading a form into InfoPath FormControl with parameters - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Loading a form into InfoPath FormControl with parameters

Last post 04-23-2010 06:28 AM by dammitandy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-17-2010 01:45 PM

    Loading a form into InfoPath FormControl with parameters

    Is there a way to pass parameters into an InfoPath FormControl hosted in a WinForms/WPF application the way they can be passed via a URL and the command line? Our forms depend on parameters passed to them on startup to execute a custom data connection to pre-populate them, but the control does not appear to support parameters.

    A bit of background on what I'm trying to do and what I've tried so far:

    We are able to download individual forms and populate them with data from a web page and are now working to build functionality to support "form packages". This involves downloading multiple InfoPath forms to a user's workstation, displaying them one at a time for data entry, printing the form, displaying the next form, and so on.

    I briefly looked into programmatically merging multiple forms into a single InfoPath file on the server and then downloading that to the client, but manipulating the multiple files in each XSN/CAB would require an in-depth knowledge of the inner workings of InfoPath that I don't have nor have a way to obtain. Unfortunately, these form packages have to be assembled on-the-fly or presented in sequence because they are used both individually as well as in package form.

    Next, I researched doing this in a simple C# console application using Process.Start to launch each form from the command line with the required input parameters, but knowing when each form is closed so the next one can be loaded is somewhat clunky. We'd also like to background load subsequent forms while the user works with the current form, but InfoPath seems to be ignoring the ProcessWindowStyle.Hidden I'm passing via the ProcessStartInfo instance.

    From there, I moved on to researching what it would take to develop a WPF application to host the forms in the InfoPath FormControl. This would allow forms to be loaded in the background and a couple navigation buttons would allow the user to move between forms and is currently the leading option provided I can find a way to pass parameters to the form on startup.

    Thanks for taking the time to read this and for any help you can provide!
  • 04-23-2010 05:34 AM In reply to

    Re: Loading a form into InfoPath FormControl with parameters

    Did you ever get a reply to this post?  I'm having a similiar issue, and need to figure out how to get values from a host on a muliti site deployment to the form, when each site is going to have different values to pass.

     If you got any direction on this, can you help me out?



  • 04-23-2010 06:28 AM In reply to

    Re: Loading a form into InfoPath FormControl with parameters

    I ended up building a WinForms "form handler" application that is triggered by the download of a custom file type. From end-to-end it goes like this:

    1. The user selects a form package on an ASP.NET web form.
    2. A generic list (List) of URLs with parameters is serialized and downloaded to the client as our custom file type. The custom file type is registered in IIS on the server and the form handler on the client is configured to handle the custom file type. This avoids a download prompt and automatically launches the form handler when the user clicks the download link.
    3. When the list is downloaded, the form handler launches in the systray. All forms are downloaded from the server using the parameterized URL and saved to a temp folder. A balloon message pops up to show "Form 1 of X", etc. as each form is loaded.
    4. When one form is closed, the subsequent form launches. After the last form has been closed, the form handler closes and the temp files are deleted.

    I'm not sure how similar my issue is to yours, but perhaps you can use a parameterized URL to pass parameters into the form. In my research, the URL and the command line seemed to be the only options for doing this.

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