is it possible to develop multiple Infopath forms in one Visual Studio solution? - InfoPath Dev
in

InfoPath Dev

is it possible to develop multiple Infopath forms in one Visual Studio solution?

Last post 12-16-2010 06:26 PM by BigToe. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-14-2010 07:13 PM

    • BigToe
    • Not Ranked
    • Joined on 10-14-2010
    • Posts 5

    is it possible to develop multiple Infopath forms in one Visual Studio solution?

    I have an Infopath 2007 template project in my Visual Studio 2008 solution. 

    I have about 100 forms to do and was hoping I dont have to create a separate project for each form.  Is it possible -- like with aspx pages, you just add a new page to your Web project -- to just add a manifest.xsf file and its associated code behind file?

  • 10-14-2010 07:44 PM In reply to

    Re: is it possible to develop multiple Infopath forms in one Visual Studio solution?

     Hi, yes on a same project you can create many form, you can copy / paste the content, code from one form to another, but keep in mind that each form must have a unique namespace( if you want to drag and drop the manifest and other files, you can have some trouble).

  • 10-14-2010 08:31 PM In reply to

    • BigToe
    • Not Ranked
    • Joined on 10-14-2010
    • Posts 5

    Re: is it possible to develop multiple Infopath forms in one Visual Studio solution?

    Thanks Potemkine for your quick reply.

    Ref: Infopath , Visual Studio 2008, Sharepoint 2007

    When I try to copy the manifest.xsf file, say, I call it manifest2.xsf.  Whenever I click on either one of them, the other one disappears.

    Also, how do you copy the FormCode.cs file (+ its xml and Designer.cs files) in Visual Studio 2008.  This option is greyed out.

    Other information: I will be deploying these infopath forms into Sharepoint 2007 when done.  And hoping to apply 1 css file to all forms -- would you know which one is the css file?

  • 10-15-2010 05:55 AM In reply to

    Re: is it possible to develop multiple Infopath forms in one Visual Studio solution?

    Hello BigToe,

    An InfoPath form is a lot more than just a manifest.xsf file, and you can't duplicate one just by copying the manifest.xsf file.

    100 different forms, each with its own custom code sounds like lunacy to me.  Have you checked out qRules yet?  qRules provides most of the functionality people generally want to accomplish with code, all in a tidy package.  No need to manage a whole bunch of code.  It includes a feature that can be used to inspect a form's input parameters and switch the form's view accordingly.  Perhaps you could use this to consolidate forms with similar data needs into single XSNs and have, say, 10 forms instead of 100?

     InfoPath forms do not typically have CSS files, but you can add a CSS file as a resource file and then reference this in each view's XSL with a <link> tag in the <head> section: 

    <link rel="stylesheet" type="text/css" href="style.css"></link>

    From the bit of experimentation I've done, this does seem to work, and not get eliminated when InfoPath roundtrips the XSL.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-15-2010 07:05 AM In reply to

    Re: is it possible to develop multiple Infopath forms in one Visual Studio solution?

    BigToe:
    When I try to copy the manifest.xsf file, say, I call it manifest2.xsf.  Whenever I click on either one of them, the other one disappears.

    I do not recommend you to do that, I suggest you to create a new project, right click on your solution on solution explorer, then new project, and create a new clean form. After than you can copy some code in the namespace or content on the manifest from one to another. To apply Css to different view, you can do the trick Jimmy said.
  • 10-18-2010 10:32 PM In reply to

    • BigToe
    • Not Ranked
    • Joined on 10-14-2010
    • Posts 5

    Re: is it possible to develop multiple Infopath forms in one Visual Studio solution?

    Thanks kindly, Jimmy and Potemkine for your ideas.  Jimmy, unfortunately, i don't have resources to buy qRules.

    Potemkine, i have created the new project as per the last reply but unless you mean differently (I'm a newbie at Infopath forms and may be missing something most Infopath experts take for granted), it looks to me that I'd end up with 100 projects for 100 forms.  So with 2 projects, I have:

    Solution 'InfopathCode'
    - MyFormProject1
       + Properties
       + References
       - InfoPath Form Code
          - FormCode.cs
       + InfoPath FormTemplate
          InfoPath.snk
    - MyFormProject2
       + Properties
       + References
       - InfoPath Form Code
          - FormCode.cs
       + InfoPath FormTemplate
          InfoPath.snk

     I'm trying to achieve this:
    Solution InfopathCodeOneBigHappyFamily
    - MyFormsFamily
       + Properties
       + References
       - InfoPath Form Code
          - FormCodeMama.cs       <----I'm hoping there's an easier way to put Mama, Papa, Sis, Bro, Junior all in one project.  If anyone knows how to easily, it's most appreciated.
          - FormCodePapa.cs        <--- I've searched the internet but haven't found the answer yet... maybe I'm going about this the wrong way?  I want the thing to be as manageable as ASP.Net code
          - FormCodeSis.cs           <--- for now, I'll stick to the first solution but hope this will help others find answers
          - FormCodeBro.cs
          - FormCodeJunior.cs
       + InfoPath FormTemplate
          InfoPath.snk


     

     

     

  • 12-16-2010 06:26 PM In reply to

    • BigToe
    • Not Ranked
    • Joined on 10-14-2010
    • Posts 5

    Re: is it possible to develop multiple Infopath forms in one Visual Studio solution?

    Just to close this off and hope that it will help others, I've created a project for each of my forms and I doubt there is a way to have only one project with many forms.  My shared code sits in a different project and is referenced in all the forms.  After successfully deploying, I thought I'd share some tips from my experience:

    - Infopath is designed for simple forms.  For complex forms that create lots of customised user experience, ASP.Net is the way to go.  Infopath is quite painful, Microsoft hasn't developed Visual Studio much to support Infopath Dev, presumably Infopath is not a money spinner for them.  So keep simple and be organised.

    - Deployment is not even simple.  There are 2 parts: Publish and Deploy.  Publish your form manually (I haven't found an automation tool).  Then to deploy, use this tool (credits to some kind guy or gal): http://infopathformsinstall.codeplex.com/releases/view/16178

    - to share code, put in a separate project, update the version of your shared project by one number up (I've found that the moment you press build, your SharedCode.dll is considered different than the previous build's one and will cause deployment errors if the version number is unchanged.  (Right click the SharedCode project > Properties, select Assembly Information, change the first number)

    Thanks to many people's contributions, in particular Potemkine.

    I live in Australia.  Come visit!  Oprah has just left...  Oprah likes infopath too, just kidding!

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