Hi,
I'm trying to figure out how to use Crystal Reports with CSLA list objects. Say I have a CustomerReadOnlyRootList that contains a collection of CustomerReadOnlyChild objects.
I can't use the list object for designing the report, as it doesn't contain my Customer properties. I can use the child object. What I'm trying to figure out is how to get this all wired up at runtime, so the report will show the results of whatever Get method gets called on the root list object.
Any help appreciated,
Mike
Funny how sometimes as soon as you ask a question, or somebody looks over your shoulder, you tend to look at things differently.
Here's some code that seems to work just fine:
ReportForm rf = new ReportForm(); CrystalReport1 report = new CrystalReport1();rf.crystalReportViewer1.ReportSource = report;
AddressReadOnlyRootList addressList = AddressReadOnlyRootList.GetAddressReadOnlyRootList();report.SetDataSource(addressList);
rf.Show();
If you're using a BindingSource object for your RootList, you can also pass the binding source object instead and avoid a database hit:
report.SetDataSource(addressListBindingSource);
That's cool, I'll give it a try.
Thanks,
Mike
Copyright (c) Marimer LLC