sharepoint 2010-如何使用VisualWebPart中显示的XmlFormView组件信息路径*.xsn文



我已按照"在SharePoint 2010中将InfoPath 2010表单发布到表单库"教程中描述的说明操作,并在SharePoint 2010的表单库中成功发布了InfoPath 2010表单。

我想开发一个自定义的VisualWebPart,它使用XmlFormView组件显示的Info-Path*.xsn文件。我已按以下方式配置了XmlFormView:

<cc1:XmlFormView … XsnLocation="/FormServerTemplates/*.xsn">
</cc1:XmlFormView>

当我将自定义VisualWebPart嵌入到任何页面上时,我都会遇到以下错误:

w3wp.exe (0x1454)
0x1594
InfoPath Forms Services
Runtime
e568
Verbose
Unexpected exception while getting file at:
http://SharePointUrl/FormServerTemplates/*.xsn.
Exception of type:SPException. Message:Cannot open file "FormServerTemplates/*.xsn".be9cb443-292a-4c80-9188-06a01e6393c5

*.xsn将不起作用,您必须从teamplate中指定特定的信息路径。

在"SharePoint 2010作为开发平台"一书的"使用InfoPath向导发布和部署->将表单模板作为单独的内容类型发布"一文中找到了解决方案:

在发布向导中,您将被要求为表单模板指定位置和文件名。您可以在网站中指定内容类型要访问的任何文档库出版。但是,表单模板的最佳位置是您的网站。此库在每个站点都可用,可以通过路径/FormServerTemplates访问

指定表单模板的位置和文件名:

http://SharePointUrl/FormServerTemplates/*.xsn

<cc1:XmlFormView … XsnLocation="/FormServerTemplates/*.xsn">
</cc1:XmlFormView>

最新更新