【问题标题】:Open form using webpart使用 webpart 打开表单
【发布时间】:2012-11-08 16:30:19
【问题描述】:

我无法使用 XmlFormView 打开信息路径表单。这里有代码:

   SPLimitedWebPartManager manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared);
   try
   {
       XmlFormView form = new XmlFormView();
       String templateLib = "FormServerTemplates";
       String xsnName = report + ".xsn";
       form.XsnLocation = String.Format("{0}/{1}/{2}", SPContext.Current.Web.Url, templateLib, xsnName);
       manager.AddWebPart(form, "TopZone", 0);      
    }

所以我创建了一个页面并添加了一个 xmlform webpart 以查看页面中的 infopath 报告。问题是当我尝试打开页面时:

无法访问表单模板 (.xsn) 文件。您可能没有打开文件所需的权限。

相关 ID:51a2dcd8-d2fa-4d8b-ae13-1b5f9caa1c51

这很奇怪,因为当我单击我在文档库中分配的内容类型时,我可以打开相同的表单,但在页面中却看不到它。这是怎么回事?

谢谢

【问题讨论】:

    标签: visual-studio-2010 c#-4.0 sharepoint-2010 infopath2010 xmlformview


    【解决方案1】:

    首先,您可以检查 SharePoint 日志中的异常并将其添加到帖子中吗?

    它们位于 C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\LOGS。您可以使用相关 ID 来查找异常。

    另外,尝试使用提升的权限,如下所示:

    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        // your code here
    });
    

    【讨论】:

      猜你喜欢
      • 2010-11-05
      • 1970-01-01
      • 1970-01-01
      • 2019-11-05
      • 1970-01-01
      • 1970-01-01
      • 2010-10-11
      • 2021-11-10
      • 1970-01-01
      相关资源
      最近更新 更多