Hi,
i am Using Infragistic 14.1 license version. in sample application i was able to use view model property as Object data source. but in my application when i am trying to use my VM property as Object data source in Report ReportDataExplorer-->ObjectdataSource-->VM Namespace.Class(select the class that will return the data)-->Select a method or Property[ here my properties are not available]
how can i make my ViewModel property to be available for choosing as object data source? so they are available in ReportDataExplorer to use in reports. Are they all should be in same namespace?
Namespace.ViewModels : public ObservableCollection<MyType> MyTypesNamespace.Views : here i am using the ReportViewer in my XAMLNamespace : here i have added myreport.igr file.
one more thing, i am using license version of INfragistics2014.1 (how can i update my profile... it shows 2014.1 trial expires) .. i am not able to log a support ticket.
Regards,Kamlendra
hi Valerie,
I am able to solve the issue.You can close this Ticket.
Hello Kamlendra,
I was still unable to reproduce your issue. I am attaching a sample using Prism and MEF with imports for the report data source. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem. If needed please modify the sample to better represent how you are using MEF to import your data so that I can investigate further.
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Thank you for the additional information, I will need to create a sample which replicates this issue so that I can investigate further. I will update you again once this is complete unless you already have a sample I could use to help jumpstart my investigation.
Hi Valerie,
I found out the reason for my VM properties not getting listed as "ObjectDataSource". The reason is : My ViewModel constructor injection and hence i constroctor is not parameterless. the moment I shift MEF Constructor injection to MEFProperty Injection Problem of VM Properties as "Object Data Source" is solved. Now,VM Constructor is parameterless. and DataCollectionForReport is getting filled by MEF property injection. and tested on button click on view, works fine.Step 1:
[Export] [PartCreationPolicy(CreationPolicy.NonShared)]ReportViewModel{ [Import] ObservableCollection<DataCollectionForReport> DataCollectionForReport{get; set;}}
and DataCollectionForReport is getting filled by MEF property injection. and tested on button click on view, works fine.
Step 2:ReportData Explorer: Drag and Drop DataCollectionForReport on report.igr
Step 3: Run app and check in ViewModel if we are getting the Injected values.: result: yes works fine.
Step 4: Export Report to PDF. here when report fetchs the property of ViewModel(DataCollectionForReport) binded to report from ReportData Explorer. It gets the injected values as Null. Does report uses the different instance of ViewModel then created by injection? i am using Prism with MEF. how can i bind a Object entity to Report which takes values from Objects injected in ViewModel.
Hello Kamlandra,
Do you have any other questions on this matter?