Suppose I have the following:
public class MyObject
{
public string Name {get; set;}
public List<MySubObject> SubObjects {get; set;}
}
public class MySubObject
{
public string SubName {get; set;}
}
Is there a way I can set up a report and sub report to show a list of MyObjects (each with a list of subreports for their respective MySubObjects?
I think your class definition is missing the name of the
List<MySubObject>:You can loop through and populate a dataset (you don’t really need to use subreports, uness your data is more complex than you’ve described above):
Then point your crystal report datasource at the dataset: