Hi there,
I get all my data for the reports out of objects and no SQL!
All the objects do have methodes that do return lists of themself (statics) or lists of other ("linked" to this instsance) objects.
simple example:
So I created two reports (company + employee) and put the second as a subreport into the first.
The main report has as a datasource "Company.getAll" and the subreport "Company.getEmployees".
Now the problem: vor every parent object the method getEmployee" is called (in this example 3 times), but the instance of company is always EMPTY!? not null - all the properties are just blank)
Please have a look at the output attached. There I expected to read "Mr. Smith & Sons", "Father of Smith & Sons", "Mr. Miller Corp." and so on...
Is there a way how I can get the real instance of the parent object into the subreport?
Thanks in advance :-)
I get all my data for the reports out of objects and no SQL!
All the objects do have methodes that do return lists of themself (statics) or lists of other ("linked" to this instsance) objects.
simple example:
class Company { public string companyname { get; set; } public static List<Company> GetAll() { List<Company> allCustomers = new List<Company>(); Company customer = new Company(); customer.companyname = "Smith & Sons"; allCustomers.Add(customer); customer = new Company(); customer.companyname = "Miller Corp."; allCustomers.Add(customer); customer = new Company(); customer.companyname = "Clarksons"; allCustomers.Add(customer); return allCustomers; } public List<Employee> getEmployees() { List<Employee> employees = new List<Employee>(); Employee person = new Employee(); person.name = "Mr." + this.companyname; employees.Add(person); person = new Employee(); person.name = "Father of " + this.companyname; employees.Add(person); return employees; } }
So I created two reports (company + employee) and put the second as a subreport into the first.
The main report has as a datasource "Company.getAll" and the subreport "Company.getEmployees".
Now the problem: vor every parent object the method getEmployee" is called (in this example 3 times), but the instance of company is always EMPTY!? not null - all the properties are just blank)
Please have a look at the output attached. There I expected to read "Mr. Smith & Sons", "Father of Smith & Sons", "Mr. Miller Corp." and so on...
Is there a way how I can get the real instance of the parent object into the subreport?
Thanks in advance :-)