错误 parentkey 和 childkey 在 Stimulsoft 中是相同的

Error parentkey and childkey are identical in Stimulsoft

我想创建一个主从报表。

我有两个 类 PayStub & Payments 付款具有 PayStubId.

的外键
public class PayStub
{
 public int PayStubId { get; set; }
 public int Code { get; set; }
 public string Name { get; set; }
}
public class Payment
{
 [ForeignKey("PayStub ")]
 public int PayStubId { get; set; }
 public  PayStub PayStub { get; set; }
 public int Amount{ get; set; }
 public string Description{ get; set; }
}

我试过两种方法:

  1. 业务 object.Insert 父业务对象和子业务对象并且在 wpf 中。

    report.RegBusinessObject("PayStub", payList); report.RegBusinessObject("Payments", paymentList);

本次展示大师不展示细节

  1. DataTable.Insert 两个 DataTable 和一个关系。

在 wpf 中:

report.RegData("PayStub", payList);
report.RegData("Payments", paymentList);

我收到错误 parentkey and childkey are identical

我是这样换模型的

public class PayStub
{
public int PayStubId { get; set; }
public int Code { get; set; }
public string Name { get; set; }
public List<Payment> Payments{ get; set; }
}
public class Payment

{ [外键("PayStub ")] public int PayStubId { 得到;放; } public PayStub PayStub { 得到;放; } public int 金额{ get;放; } public 字符串描述{ get;放; } }

并在 PsyStubList 中设置付款值。

并仅针对 PayStub

设置 BusinessObject
report.RegBusinessObject("PayStub", payList);