I think it is most convenient to use web services to interact with infopath. infopath can only extract data from databases (SQL Server and access), rather than directly edit data. Through the web service, infopath submits XML data for further data processing. Infopath pages can also be beautiful, which is equivalent to web pages.
However, the original physical path is saved in the template generated by infopath. If you copy the template file to another host, the form cannot be opened. What is the problem?
After studying infopath for a while, it is very convenient to use it. When designing a template, you can add verification conditions and custom rules for each of its controls, which is convenient to operate, even if you do not understand programming.
Infopath 2003 toolkit for Visual Studio. NET, a component found on the Internet, can be integrated with the. NET Framework and can be used to edit background code in C # to expand the functions of the program. After the installation is successful, a new project type is created in Microsoft Visual Studio. NET 2003. For example:
Click this link to download. infopath 2003 toolkit for Visual Studio. NET.
Example: C # background code
Using system;
Using system. Web;
Using system. Web. UI;
Using Microsoft. Office. InterOP. infopath. semitrust;
// Office integration attribute, indicating the startup class of the form. Do not modify.
[Assembly: system. componentmodel. descriptionattribute ("infopathstartupclass, version = 1.0, class = infopathproject1.infopathproject1")]
Namespace infopathproject1
{
// The namespace prefix defined in the attribute must be synchronized with the form definition file (. xsf.
[Infopathnamespace ("xmlns: xdutil =/" http://schemas.microsoft.com/office/infopath/2003/xslt/Util"
Xmlns: xdxdocument =/"http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument"
Xmlns: XD =/"http://schemas.microsoft.com/office/infopath/2003"
Xmlns: My =/"http://schemas.microsoft.com/office/infopath/2003/myXSD/ 2006-03-15 T02: 16: 17 /"
Xmlns: msxsl =/"urn: Schemas-Microsoft-com: XSLT/" xmlns: xdmath =/"http://schemas.microsoft.com/office/infopath/2003/xslt/Math"
Xmlns: xsf =/"http://schemas.microsoft.com/office/infopath/2003/solutionDefinition"
Xmlns: xddate =/"http://schemas.microsoft.com/office/infopath/2003/xslt/Date"
Xmlns: xsi =/"http://www.w3.org/ 2001 /XMLSCHEMA-instance/"")]
Public class infopathproject1
{
Private xdocument thisxdocument;
Private application thisapplication;
Public void _ startup (Application app, xdocument DOC)
{
Thisxdocument = Doc;
Thisapplication = app;
// You can add other initialization code here.
}
Public void _ Shutdown ()
{
}
}
}