【问题标题】:Generating summary reports with Sitecore Webforms For Marketers使用面向营销人员的 Sitecore Webforms 生成摘要报告
【发布时间】:2014-02-14 11:38:34
【问题描述】:

我将 Sitecore 与面向营销人员的 Webforms (WFFM) 插件一起使用。使用 WFFM,我创建了多种表格。所有表单都正常工作,但某些表单在生成摘要报告时出现错误。

Value cannot be null.
Parameter name: items

Stack trace:
[ArgumentNullException: Value cannot be null.
Parameter name: items]
   Sitecore.Form.UI.Converters.ListItemsAdapter.AdaptList(IList list) +330
   Sitecore.Form.Core.Utility.FieldReflectionUtil.ListAdapt(FieldItem field) +258
   Sitecore.Forms.Data.PoolManager.GetInitialApplicants(FieldItem fieldItem) +49
   Sitecore.Forms.Data.PoolManager.GetApplicants(FieldItem item, IEnumerable`1 polls, Boolean onlyDefined) +136
   Sitecore.Forms.Shell.UI.FormDataViewerPage.LoadSummary() +476
   Sitecore.Forms.Shell.UI.FormDataViewerPage.SummaryRender() +43
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3554

您可以通过单击 Sitecore 开始按钮 -> 面向营销人员的 Web 表单 -> 表单报告来生成摘要报告。选择一个表单并单击“摘要”选项卡。

我查看了工作和不工作的表格 - 我的结论是我发现配置没有区别。奇怪的是,每个表单都正确地存储了数据。有人有解决办法吗?

非常感谢。

乔迪

【问题讨论】:

  • 您是否使用任何自定义表单域?损坏的报告中使用了更复杂或更突出的字段吗?
  • 是的,没错。我正在使用自定义表单字段。
  • 您能在这些字段和不想加载的报告之间找到一种模式吗? (就像总是有 1 个自定义控件只出现在损坏的报告中)
  • 太棒了。自定义控件是导致此错误的原因。你知道我该如何解决这个问题吗?
  • 您能否在您的问题中添加有关自定义控件的代码和信息?也许我们可以查明问题。

标签: c# asp.net .net sitecore web-forms-for-marketers


【解决方案1】:

我的猜测是您没有覆盖 Result 的类来输出您的自定义字段。

这是一个带有文本框的自定义 RadioList 示例。输出是用户选择的任何内容,除非用户选择了 radioList 中的最后一项,他/她必须提供附加信息。

   public override ControlResult Result
        {
            get
            {
                return new ControlResult(this.ControlName,
                                     (this.buttonList.SelectedItem != null 
                                        && this.buttonList.SelectedIndex == this.buttonList.Items.Count - 1
                                        && !string.IsNullOrEmpty(this.InputText.Text)) ?
                                     this.buttonList.SelectedItem.Text + ", " + this.InputText.Text :
                                     (this.buttonList.SelectedItem != null? this.buttonList.SelectedItem.Text  : string.Empty),
                                      this.buttonList.SelectedValue ?? string.Empty);

            }
        }

希望这会有所帮助, 动态

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多