2
votes

We have a 3rd party component that takes INPUT as an .xsn (InfoPath2007) file and gives a pre-determined output. It was all fine until one of our client decided not to use MS-InfoPath anymore and as such even our 3rd party component is not able to function as we are not able to create xsn files (which were created by a human-InfoPath user till now, until InfoPath was discontinued in their group)... so the challenge for us is to create these SIMPLE (textbox, dropdown, date-picker and check-radio-box controls) InfoPath like forms -- .XSN files programmatically. Is this possible? Are there any APIs or Object-model based functions that can be leveraged for this task. Our team is predominantly C# developers. Our current analysis reveals that files pertaining to manifest, XML, J-scripting parts of .XSN might be achievable after some careful coding... however XSL (part that is associated with layout) seems to be a big gamble. Any pointers on this subject will be greatly appreciated.

UPDATE (as the problem statement does not seem to clear yet):
We do not want to convert InfoPath form into any HTML or alike format. NOW here, we need to create some simple (pre-determined control-types with their known data) InfoPath forms programatically in .xsn file format. We want this to be done programatically, because earlier it was being done by a human-client who no longer subscribes to InfoPath-license and hiring another human for doing this is ruled out for various HR-reasons. So this "programatically"created xsn-file is fed it into this 3rd party component. Then this 3rd party component reads through the various parts inside the xsn-input and manipulates on it, into an output custom-file-frmat such that the custom 'workflow-component' keeps working further ahead... so hope you get the bigger picture now. Now an xsn file is essentially a CAB file consisting of many parts-components like manifest, xsL, xsD, xmL, images, jScript etc. So now if I have a winforms or ASP.NET webform... is it possible to write some component (using InfoPath object model or APIs) which can read through the UI-controls of this winform and then come up with the essentials that need to go into xsL, xmL, manifest etc so as to "collectively get compressed" into an InfoPath form!!!

1
What do you want the InfoPath files converted to? HTML?Sean B. Durkin
We do not want the InfoPath files converted to anything like HTML or alike... the 3rd party component that we have expects '.xsn' (obviously along with its all components like manifest, xsl, xml, images, jscript etc) and converts that into another custom-file-format which is recognized and read by an independent-and-custom 'workflow-component'... so hope you get the bigger picture now. We need to create some simple (pre-determined) InfoPath forms programatically in .xsn file format and feed it into this 3rd party component so that the custom 'workflow-component' keeps working further ahead.Work Winshuttle

1 Answers

2
votes

Yes it is possible to Automatically create InfoPath Template Forms. The XSN is nothing but a cabinet file (.CAB) having the extension renamed to .xsn.

To further understand what are the contents of CAB file and what do they do, please follow the link:

A beginner's guide to forms and form templates

Following are the links that shall help you further.

Microsoft Cabinet Software Development Kit

A relevant Q&A to open CAB through C# program