Do you have an InfoPath form that was created in the InfoPath client and now you want to add it to a Visual Studio InfoPath project?
Here are the basic steps.. Follow along kids.
- Extract the source files from your client side form in to a directory called ClientSource. (you should know how to do this)
- Create a new InfoPath project in Visual Studio
- Close the open xsf file in Visual Studio
- Delete all the files under InfoPath Form Template directory in the Visual Studio solution
- In the ClientSource directory, edit the manifest.xsf file in NotePad++ or your favorite text editor and make the following changes.
- Delete the attributes "publishUrl and "trustLevel" (if exists) of the xsf:DocumentClass element
- Delete the properties xsf:property name="componentId" and xsf:property name="xmlToEditName"
- Add the sibling <xsf2:managedCode projectPath="path to and including csproj" language="CSharp" version="2.0" enabled="yes"></xsf2:managedCode> under xsf:extensions/xsf:extension/xsf2:solutionDefinition/xsf2:offline
- Path to and including csproj, ex: "C:\infopathForms\myIPFormProj\myIPFormProj.csproj”
- language value could also be VisualBasic, if you have create a VB project.
- Add the attribute scriptLanguage="managedCode"as the first attribute of xsf:applicationParameters/xsf:solutionProperties
- Save your changes
- Open template.xml in a text editor and make the following change
- In your Visual Studio project, right click on InfoPath Form Template folder and choose Add >> Existing Item.
- Navigate to your ClientSource directory
- Change the object type dropdown to ALL Files (*.*)
- Select ALL the files in the directory and click ADD
- NOTE: you want to bring in all the files so that you bring in all your data connections, resource files, view styles…
- In Visual Studio double click on manifest.xsf
- When/If prompted to save changes and publish, blah blah blah… click OK
- Build your project
That’s it…





0 comments:
Post a Comment