创建使用 InfoPath Forms Services 的 InfoPath 表单模板

部署到 Microsoft SharePoint Server 2013 的与浏览器兼容的表单,InfoPath Forms Services支持涵盖大多数 InfoPath 表单使用方案的功能和控件。 但是,InfoPath Forms Services提供的与浏览器兼容的表单不支持所有 InfoPath 功能。 某些功能和控件未在服务器上实现。 其他功能在服务器上没有有意义的表示形式。

以下几节具体说明与浏览器兼容的表单中支持的功能、不能使用的功能,以及可以为与浏览器兼容的表单指定但不能在 Web 浏览器中正常工作的功能。

InfoPath 和 InfoPath Forms Services 都支持的功能

以下各节列出受部署到 InfoPath Forms Services 且可在 InfoPath 和浏览器中打开的浏览器兼容的表单模板支持的功能。

控件

可在 InfoPath 和浏览器中打开的表单模板支持下列控件。

  • 文本框

  • 格式文本框(仅可在 Microsoft Internet Explorer 中进行编辑)

  • 下拉列表框

  • 列表框

  • 日期选取器(在 Internet Explorer 之外的其他浏览器上显示为文本框)

  • 复选框

  • 选项按钮

  • 按钮

  • Section

  • 可选节

  • 重复节

  • 重复表

  • 文件附件

  • 超链接

  • 表达式框

  • 组合框

  • 多选列表框

  • 项目符号列表

  • 编号列表

  • 普通列表

  • Picture

  • 选项组

  • 选项节

  • 个人/组选取器

  • 外部项选取器

  • 图片按钮

  • 计算的值

声明性功能

在 InfoPath 和浏览器中都能工作的其他声明性功能:

  • 规则

  • 计算

  • Validation

注意

[!注释] 将启用简单的规则、计算和数据验证并在使用 JScript 的浏览器中运行。 复杂的规则、计算和数据验证需要回发才能在服务器上执行这些操作。

代码

业务逻辑代码必须基于由 Microsoft.Office.InfoPath 命名空间提供的 InfoPath 托管代码对象模型。 服务器上运行的业务逻辑代码将受以下限制所约束:

  • 由于每个服务器请求可能由不同的前端处理,并且 InfoPath Forms Services 将仅加载业务逻辑的一个实例,因此编程人员无法依靠存储在全局或静态变量中的数据。 若要解决此问题,业务逻辑必须将状态存储到属性包中,并由 FormState 属性提供对属性包的访问。

  • Microsoft.Office.InfoPath 命名空间的成员的子集提供的信息权限管理 (IRM) 等功能不受服务器支持。 有关受支持和不受支持的对象模型成员的详细信息,请参阅本主题后面的"在 InfoPath 和 InfoPath Forms Services 中工作的对象模型成员"和"仅在 InfoPath 中工作的对象模型成员"两节。

  • 服务器上不支持使用 VBScript、JScript 以及由 Microsoft.Office.Interop.InfoPath.SemiTrust 命名空间的成员提供的 InfoPath 2003 兼容的对象模型所编写的业务逻辑。

不受 InfoPath Forms Services 支持的功能

以下各节列出不受部署到 InfoPath Forms Services 且可以在 InfoPath 和浏览器中打开的浏览器兼容的表单模板支持的功能。

在 InfoPath 设计模式中使用 "检查设计方案" 功能来确认与 InfoPath Forms Services 间的兼容性时,不受支持的功能将生成错误或消息。 生成错误的功能会阻止将表单模板发布为启用浏览器功能的模板。 将允许使用生成消息的功能,但当在浏览器中打开表单时,该特定功能将不会运行。

控件

可在 InfoPath 和浏览器中打开的表单模板不支持下列控件和控件功能。

  • 重复控件上的筛选

  • 大纲/细节

  • 竖排标签

  • 水平重复表

  • 墨迹图片

  • 重复递归节

InfoPath Forms Services 不支持或不完全支持的其他功能

InfoPath Forms Services 上不支持的其他功能:

  • ActiveX 控件

  • HTML 任务窗格

  • 控件中的占位符文本。 例如,"Click here to enter text"(浏览器中不显示任何文本)

  • 数据库数据连接被限制为以只读方式访问 SQL 服务器数据库

  • 用户角色

  • 通过对象模型的数字签名可扩展性。 通过仅在 Microsoft Internet Explorer 中运行的 ActiveX 控件提供对服务器上的数字签名的支持。

  • 工作流服务 (HWS) 集成。 HWS 已被 BizTalk 服务器弃用。

  • XML 架构错误消息覆盖。 这是一项极少使用的功能,它允许表单设计人员在文档无法验证时(通常由于类型不匹配)提供不同于 MSXML 或 System.Xml 提供的消息。 此功能在设计器用户界面中不受支持,并需要手动编辑表单定义 (.xsf) 文件。

InfoPath Forms Services 中无直接对等项的功能

InfoPath Forms Services 上不支持的其他功能:

  • 无模式验证期间的弹出式对话框

  • Outlook 集成

  • COM 加载项

  • 合并表单

  • 自动保存、崩溃检测和恢复

  • 邮件信封

  • 导出至 Excel

  • 包括 "墨迹图片" 控件的 Tablet/墨迹功能

  • 撤消/恢复

  • 信息权限管理 (IRM)

  • 来自业务逻辑的模式对话框

  • XSLT 可扩展性 (xd:preserve块)

  • 外部自动化

  • 脱机查询缓存

  • 拼写检查

  • 受限安全模式

注意

[!注释] 在 InfoPath 设计模式下使用 "检查设计方案"功能时,上述功能不会产生任何错误或消息通知。

在 InfoPath 和 InfoPath Forms Services 中工作的对象模型成员

InfoPath 提供了新的托管代码对象模型,它具有一组用于在表单模板中创建自定义业务逻辑的核心功能。 将使用这一新的对象模型创建的业务逻辑部署到 SharePoint Server 2010(带有 InfoPath Forms Services)中时,它将在 Web 浏览器和 InfoPath 中运行。 您可以根据需要编写业务逻辑,以使用此对象模型提供的额外功能级别,这些功能将仅在表单模板于 InfoPath 中打开以供编辑时运行。

To write business logic that will run when a form is opened in both a Web browser and in InfoPath, select the Enable browser-compatible features only check box on the Design a Form Template dialog box when creating a new form template. To write business logic that can use additional functionality only when opened in InfoPath, clear the Enable browser-compatible features only check box when creating a new form template. You can also change this setting after creating a form template, by clicking Change Compatibility Settings on the Design Checker task pane, and then selecting or clearing the Design a form template that can be opened in a browser or InfoPath check box. If you choose to create a browser-compatible form template, the compiler will display an error if you have used any classes or members that are not compatible with InfoPath Forms Services.

注意

[!注释] 将包含托管代码且启用浏览器功能的表单模板发布到 SharePoint Server 2010(带有 InfoPath Forms Services)或某个共享位置后,服务器管理员必须上载并批准该表单模板,然后它才能运行。

InfoPath 和 InfoPath Forms Services 都支持以下由 Microsoft.Office.InfoPath 命名空间提供的 InfoPath 托管代码对象模型的类和成员。

父类 成员
AdoQueryConnection
BuildSqlFromXmlNodes
Command
Connection
Timeout
BuildSqlFromXmlNodes
Command
Connection
Timeout
Application
Environment
Name
User
ButtonEvent
Clicked
ClickedEventArgs
ControlId
Source
ControlEvents
Item
DataConnection
Execute
Name
DataConnectionCollection
Count
GetEnumerator
Item
Item
DataSource
CreateNavigator
GetNamedNodeProperty
Name
QueryConnection
ReadOnly
SetNamedNodeProperty
DataSourceCollection
Count
GetEnumerator
Item
Item
EmailAttachmentType
None
Xml
XmlXsn
EmailSubmitConnection
AttachmentFileName
Bcc
CC
EmailAttachmentType
Execute
Introduction
Subject
To
Environment
IsBrowser
IsMobile
EventManager
ControlEvents
FormEvents
XmlEvents
FileQueryConnection
Execute
FileLocation
FileSubmitConnection
Execute
Filename
FolderUrl
FormError
DetailedMessage
FormErrorType
Message
Name
Site
FormErrorCollection
Add
Add
Count
Delete
Delete
DeleteAll
GetEnumerator
GetErrors
GetErrors
Item
FormErrorType
SchemaValidation
SystemGenerated
UserDefined
FormEvents
Loading
Submit
VersionUpgrade
ViewSwitched
FormTemplate
Manifest
OpenFileFromPackage
Uri
Version
LoadingEventArgs
CancelableArgs
InputParameters
SetDefaultView
SetDefaultView
SharepointListQueryConnection
Execute
QueryThisFormOnly
SiteUrl
SubmitEventArgs
CancelableArgs
User
LoginName
UserName
VersionUpgradeEventArgs
CancelableArgs
DocumentVersion
FormTemplateVersion
View
ViewInfo
ViewInfo
Caption
Name
ViewInfoCollection
Count
Default
GetEnumerator
Initial
Item
Item
SwitchView
SwitchView
WebServiceConnection
Execute
GenerateDataSetDiffGram
ServiceUrl
SoapAction
Timeout
WsdlUrl
XmlEvent
Changed
RaiseUndoRedoForChanged
Validating
XmlEventArgs
Match
NewValue
OldParent
OldValue
Operation
Site
UndoRedo
XmlEvents
Item
Item
XmlForm
CurrentView
DataConnections
DataSources
Errors
FormState
MainDataSource
NamespaceManager
New
NotifyHost
QueryDataConnection
ReadOnly
Signed
Submit
Template
Uri
ViewInfos
XmlLang
XmlFormCancelEventArgs
Message
MessageDetails
XmlOperation
Delete
Insert
None
ValueChange
XmlValidatingEventArgs
ReportError
ReportError
ReportError
XPathTypedValue
Evaluate
SetStringValue
ToString
XPath

仅在 InfoPath 中工作的对象模型成员

仅 InfoPath 支持以下由 Microsoft.Office.InfoPath 命名空间提供的 InfoPath 托管代码对象模型的类和成员。

注意

[!注释] 如果您编写了可确定表单是在浏览器中还是在 InfoPath 中打开的条件逻辑,则可以将这些对象模型成员用在启用浏览器功能的表单模板的代码中。 有关详细信息,请参阅编写确定运行时环境的条件逻辑

父类 成员
ActionType
Copy
Cut
删除
Paste
XCollectionInsert
XCollectionInsertAfter
XCollectionInsertBefore
XCollectionRefreshFilter
XCollectionRemove
XCollectionRemoveAll
XFileAttachmentAttach
XFileAttachmentOpen
XFileAttachmentRemove
XFileAttachmentSaveAs
XOptionalInsert
XOptionalRemove
XReplaceReplace
Application
ActiveWindow
CacheFormTemplate
ComAddIns
GetFormTemplateLocation
IsDestinationReachable
LanguageSettings
MachineOnlineState
Quit
Quit
RegisterFormTemplate
RegisterFormTemplate
UnregisterFormTemplate
UsableHeight
UsableWidth
Version
Windows
XmlForms
Certificate
ExpirationDate
IssuedBy
IssuedTo
Status
CertificateStatus
Error
Expired
NotTrusted
Revoked
Valid
ContextChangedEventArgs
ChangeType
Context
UndoRedo
ErrorMode
Modal
Modeless
ExportFormat
Mht
Pdf
Xps
FormError
ErrorCode
FormErrorCollection
Add
Add
FormEvents
ContextChanged
Merge
Save
Sign
FormTemplate
CacheId
HtmlTaskPane
HtmlDocument
HtmlWindow
Navigate
MachineState
IEInOfflineState
Offline
Online
MailEnvelope
Available
Bcc
CC
EmailAttachmentType
Introduction
Subject
To
Visible
MergeEventArgs
CancelableArgs
Count
Index
Rollback
Xml
Permission
ApplyPolicy
DocumentAuthor
Enabled
PermissionFromPolicy
PolicyDescription
PolicyName
RequestPermissionUrl
StoreLicenses
UserPermissions
PermissionType
Change
Edit
Extract
FullControl
ObjectModel
Print
Read
Save
View
SaveEventArgs
CancelableArgs
CloseIfSaveCancelled
Filename
IsSaveAs
PerformSaveOperation
Signature
Certificate
Comment
Sign
SignatureBlockXmlNode
Status
SignatureCollection
Count
CreateSignature
GetEnumerator
Item
SignatureRelation
Cosign
CounterSign
Single
SignatureStatus
Error
Invalid
Unsupported
Valid
SignedDataBlock
Caption
Name
Sign
SignatureContainer
SignatureRelation
Signatures
XPath
SignedDataBlockCollection
Count
GetEnumerator
Item
ShowSignatureDialog
SignEventArgs
SignatureWizard
SignedDataBlock
TaskPane
TaskPaneType
Visible
TaskPaneCollection
Count
GetEnumerator
Item
Item
TaskPaneType
BulletsNumbering
ClipArt
Find
Formatting
Html
ParagraphFormatting
Replace
Spelling
User
IsUserMemberOf
UserPermission
ExpirationDate
Permission
Remove
UserId
UserPermissionCollection
Add
Add
Add
Add
Count
GetEnumerator
Item
Item
Remove
RemoveAll
View
DisableAutoUpdate
EnableAutoUpdate
ExecuteAction
ExecuteAction
Export
ForceUpdate
GetContextNodes
GetContextNodes
GetSelectedNodes
SelectNodes
SelectNodes
SelectNodes
SelectText
SelectText
ShowMailItem
Window
ViewInfo
HideName
Window
Activate
Active
Caption
Close
Close
CommandBars
Height
Left
MailEnvelope
TaskPanes
Top
Width
WindowState
WindowType
XmlForm
WindowCollection
Count
GetEnumerator
Item
WindowState
Maximized
Minimized
Normal
WindowType
Designer
Editor
XmlChangingEventArgs
CancelableArgs
XmlEvent
Changing
XmlForm
Close
Dirty
Extension
GetWorkflowTasks
GetWorkflowTemplates
Host
Hosted
HostName
MergeForm
MergeForm
Permission
Print
Print
Recovered
Save
SaveAs
SetSaveAsDialogFilename
SetSaveAsDialogLocation
SignedDataBlocks
TaskPanes
UserRole
XmlFormCollection
Count
XmlFormCollection
GetEnumerator
Item
New
New
NewFromFormTemplate
NewFromFormTemplate
NewFromFormTemplate
NewFromFormTemplate
Open
Open
XmlFormOpenMode
XmlFormOpenMode.Default
XmlFormOpenMode.FailOnVersionMismatch
XmlFormOpenMode.FailOnVersionOlder
XmlFormOpenMode.IgnoreDataConnectionsFailure
XmlFormOpenMode.PromptIfSigned
XmlFormOpenMode.ReadOnly
XmlFormOpenMode.TransformEvenIfSigned
XmlFormOpenMode.UseExistingVersion
XmlFormOpenMode.UseFileConverter
XmlValidatingEventArgs
ReportError