Create a template from C#

A

Andy

Hi,
I have a requirement to create a infopath form template from a c#
application. The application will ask the user for an xsd and a root
element and then build the form for them to complete. Anyone know if
this is possible?

Thanks
Andy
 
S

Shiva (GGK Tech)

Hello,
We can create the solution for this taking the input as template.xml file.

Take the input .xml file as string in one text box.

1. Add the button and add the below code to create the solution with the
data of given above .xml
2. Gets the node using the above .xml input value,
IXMLDOMDocument2 newDOM = Get the DOM from input xml string.
3. Gets the url of the solution using code,
string url =
“http://<ServerName>/<SiteName>/<LibraryName>/Forms/template.xsnâ€
4. Create the new solution with .xml file as input,

XDocument newDocument =
thisApplication.XDocuments.NewFromSolutionWithData(newDOM, url, 1);

If you open this form and submit it also it will not open again because it
is mismatch of the existing schema and created schema of the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top