2

我在 wpf 项目中有两个类,你能看到以下内容:

public class Employee
{
    public int Id { get; set; }
    public String Name { get; set; }
    public String LName { get; set; }
    public Company Companys { get; set; }
}
 public class Company
{
    public int Id { get; set; }
    public String Name { get; set; }
    public IList<Employee> EmployeeList { get; set; }
}

以及填充数据对象并在stimulsoft中使用的以下代码

Employee emp = new Employee()
            {
                Companys = new Company() {Id = 1, Name = "Ava"},
                LName = "Tavazoei",
                Name = "Javad"
            };
        StiReport report = new StiReport();
        report.Load(
            new Uri(
                "pack://application:,,,/Users/SayeGostaran/Documents/visual studio2012/Projects/TestWpfProject/TestWpfProject/ReportTest1.mrt")
                .LocalPath);
        report.RegBusinessObject("Emp", "Emp", emp);
        report.ShowWithWpf();

现在我想在公司类中使用公司名称,但 stimulsoft 找不到它。

4

1 回答 1

0

您需要将业务对象与下一个代码同步:

report.RegBusinessObject("Emp", "Emp", emp);
report.Dictionary.SynchronizeBusinessObjects(3);
report.ShowWithWpf();
于 2013-08-22T06:43:37.023 回答