问题
I have an MVVM application and would like to add Crystal Reports. I have a ViewModel of PatientList and would Like to Bind the Report to an Observable collection of Patients in the ViewModel. the Collection is not appearing in the data sources window.
回答1:
I guess you are refering to Crystal-Reports datasource window right?
If so - I think you will never find the ObservableCollection there (and I don't know if you can have CR observe the collection) but on the document-class in Crystal-Report you should have something like SetDatasource
(I don't have the newest version anymore and CR changed this from time to time) - in the last version I know you had to cast to IEnumerable<...>
in some cases (DataTable
) so look out for this too.
来源:https://stackoverflow.com/questions/9767923/crystal-reports-mvvm-data-source