I love getting interesting questions thrown my way, it gives me the opportunity to not only learn something new, but also find out what Crystal Reports users are trying to do, and just how functional Crystal Reports is.
The question that crossed my path a couple of times is one that has been showing up in our forums, how to build reports off of the Entity Data Model (EDM) Framework.
Not having any idea what this was or why one would want to use it I did some searching and came across this web site that had a great introduction to this http://www.devx.com/codemag/Article/36133/0/page/1
I followed this just to the point where I could display the Northwind Customers table in a datagrid. Then I went and tried to create a report off of the EDM Customers table, and it was amazingly easy to do.
I am going to assume when you are reading this you already have your EDM already created, if you haven't and don't know where to begin, I suggest the link above.
To report off of this is two steps, first you have to create the report:
The second thing you need to do is set datasource at runtime. This is simple as creating an instance of your EDM in code, and calling the report's SetDataSource method like this:
//===============================
// Create an instance of the Customers table
EntityModel.Customers emCustomers = new Customers();
// Create and instatiate strongly-typed report
CrystalReport1 MyCrystalReport1 = new CrystalReport1();
// Set the report's datasource to my EDM and then view
MyCrystalReport1.SetDataSource(emCustomers);
crystalReportViewer1.ReportSource = cr;
//===============================
As you can see this is fairly simple to do.
Happy Reporting!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
10 | |
10 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 |