2013-08-21 3 views
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; } 
} 

다음 코드 데이터 오브젝트를 작성하고

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에서 사용하기위한 회사 클래스의 이름이지만 stimulsoft는 그것을 찾을 수 없습니다.

답변

0

옆 코드와 비즈니스 오브젝트 동기화 놈이야 :

report.RegBusinessObject("Emp", "Emp", emp); 
report.Dictionary.SynchronizeBusinessObjects(3); 
report.ShowWithWpf();