How to generate an infopath file from a .NET program

A

Andre Truong

I want my program to dynamically generate the infopath
file based on runtime generated layout (basic
questions/answers structure) and data (basic xml
structure).

Is it possible or will this be made possible in the near
future?

Thanks, andre
 
A

Andrew Ma [MSFT]

There aren't any .NET libraries that will generate InfoPath Forms directly
for you.

Are you wanting to create an InfoPath Form Template? Or just and InfoPath
Form?
Either way, Infopath files are standard XML. There is a variety of ways to
create XML in .NET, I suggest you get a book because the topic is pretty
large.
InfoPath Form Templates (XSN files) are just a bunch of files compressed
using the CAB format.
This will hopefully get you started. Let me know if you have more questions.

--
Andrew J. Ma
Software Test Engineer
Microsoft Office InfoPath
http://blogs.msdn.com/ajma
---------------------------------------
This posting is provided "As Is" with no warranties, and confers no rights.
Use of any included script sample are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
Please do not send email directly to this alias. This alias is for
newsgroup purposes only.
 
A

Andre Truong

Thanks Andrew. In my Visual Basic program, I've got a user interfance to
create a questionaire and I want to create an infopath form out of it.

At this point, I've got a an XML definition of my template which corresponds
to an XForm-compliant questionaire (header and line items representing
questions as string and answers as date/integer/string/boolean) and I've got
also the XML data representing the questions and answers.

Now I need to find a way to build programmatically an infopath XSN file
based on the XML template and data. The reason why I cannot use the Infopath
Design tool is that I cannot rely on predefined infopath forms as I don't
know yet at program runtime the nature of my questions and answers.

What I need to achieve that is to follow the specifications from Microsoft
of the infopath template (manifest.xsf, view.xsl, example_form.xsd, ...) if
such specifications are made public by Microsoft.

Greatly appreciate your feedback here.
 
M

Matthew Blain \(Serriform\)

All of the information you need should be in the Developers Reference (open
infref.chm from your Office install directory) or the InfoPath SDK (download
from the Office Online site). The XSN is just a CAB file, you can expand it
yourself or use the Extract Form Files item in the InfoPath designer to take
a look at the sample forms.

--Matthew Blain
http://tips.serriform.com/
 

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