I'm trying to create a report in my WPF application. I'm using Visual Studio 2010, C# and MVVM
I have researched alot and only found articles on the net that deal with Crystal Report by using a database. In my application, I don't communicate with the database directly. We use a web service. It communicates with the database and writes all the data in xml files. We get our info via stored procedures. Hopefully that is not a problem.
Anyway, on one of my User Controls, I have a datagrid that is populated with data from the database. I store this data using a List and Observable Collection. So retreiving the data is easy. But I would now like to export the data into a report for the user to print.
As I said, I've read up on reports, and they all use some form of dataset or datatable. But as I've stated, we don't use the database directly.
I have downloaded the SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads just to ensure I can use Crystal Reports.
I have an idea that I must create a new User Control or Window View and set the datacontext via ViewModel. On this form should be a Report Viewer control, that would be populated. But I don't know what to pass through, if I can do something like this. Can I send over the List/ObservableCollection that has the data I want saved to the form, and bind it to the report control? Using [this] as an example 2, this is kind of the direction I'm looking for
Or is there another way of creating a report without using a database? I just generally want to create a report in my existing WPF project. A new window or user control is opened and the report viewer is loaded here, with the data I have in a gridview. Using WPF and MVVM, how do I achieve this.
I also have Component One if anybody knows how to use this. The website itself doesn't offer great tutorials on the subject of thier report views.
Please let me know if there is anything else you need from me, and I'll make edits where I can