1. Rename "form.XSN" to "form.ZIP"
2. Extract template.XML and view1.XSL
3. Run the code to convert template.XML to template.HTML
4. Verify that template.HTML looks ok
4. Loop thru other xml docs in your sharepoint library created from that infopath template and convert them all to htmls.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Xsl;
using System.Web ;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string path;
path = @"R:\\XSN\\EmployeeOrientationForm\\";
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(path+"view1.xsl");
// Execute the transform and output the results to a file.
xslt.Transform(path+"template.xml", path+"template.html");
}
};
}
http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform.aspx
http://code.cmsstores.com/infopath-form-to-html-using-c/
http://vamsheewithyou.blogspot.com/2010/12/infopath-form-to-html-using-csharp.html
Thank you for visiting my blog. It is all started with Microsoft Word/Excel document recovery method that I implemented at work. My coworkers were so impressed that they “forced” me to create a webpage and post steps required for that method. Later I realized that not many people are reading this blog and I decided to keep it for myself and post here some code and ideas that I could reuse for the future. If you find my posts useful drop a comment for me.
Tuesday, January 31, 2012
Convert InfoPath form to a WebPage
Labels:
InfoPath,
Sharepoint 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment