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
Hello Kamlendra,
First off, in order to update your account to the correct support level, you need to register your key to your account. This can be done at https://es.infragistics.com/my-account/register-product.
As far as using the collection from your ViewModel in a different namespace, I followed the steps you suggested and was unable to reproduce the behavior you're describing. I create a WPF application with two folders/ namespaces for the View and the ViewModels, I then added a report to the main application namespace and used a collection from the ViewModel as the data source. I then added the report viewer to my view when running the application, the data was displayed successfully in the report.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 14.1.20141.1007 in Infragistics Reporting 14.1.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if I can provide any further assistance.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Were you able to resolve your issue?
i am using 14.1.20141.1007 for infragistics reporting. but rest of my application is developed on 13.1.20131.2204. i don't want to migrate the whole application to new infragistics version. just for one reporting module, which is in initial stage. is it the issue related to different version? what is the eligiblity criteria for any property to be used as object data source.
regards,kamlendra
Hello Kamlandra,
Object Data Sources can retrieve objects from any public class method or property that returns an implementation of IEnumerable<Type> , where Type has at least one public property with a public Get method. You can retrieve objects from any existing class that fulfills that requirement.
As your ViewModel is independent of any version of Infragistics you are using this should not have any effect on the issue since we both tested in version 14.1.20141.1007. In fact, I would expect this to work as described in 13.1 reporting as well.
If you can provide a simple sample demonstrating your issue I can look into this further.
Please let me know if you have any questions.
hi Valerie,
I am able to solve the issue.You can close this Ticket.
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.
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.
Do you have any other questions on this matter?