This is a migrated thread and some comments may be shown as answers.

Telerik Reporting and EF5 DbContext

9 Answers 187 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 18 Feb 2013, 03:27 PM

I've downloaded the latest (v6.2) trial version of Telerik Reporting but cannot figure out how to hook it up to my Entity Framework model.

I've added an EntityDataSource to the designer but this requires a typeof(ObjectContext)which I don't have.

Looking at the example code from the Telerik website it appears I might be able to cast from DbContext to ObjectContext at runtime but this does not (that I can see) enable me to build a report at design time.

Is it possible to get Telerik Reporting to work with Entity Framework 5?

9 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 19 Feb 2013, 09:28 AM
Hi Peter,

The EntityDataSource component is meant to bind only to ObjectContext (so that it is compatible with the old .NET 3.5 version of Entity Framework) and it does not support DbContext directly. In that case you have two options. The first and the better one is to work with the ObjectDataSource because you are already working with POCOs and it will be very easy. The second one is to extract the ObjectContext from the DbContext wrapper. It is not as simple as using a property, but can be valuable if you insist on working with the EntityDataSource. More information you can find in this Accessing ObjectContext Features from EF 4.1 DbContext article.

We would have DbContext support in mind for subsequent version of the product (most probably once we drop support for older versions of the .NET framework).

Kind regards,
Steve
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Peter
Top achievements
Rank 1
answered on 19 Feb 2013, 09:53 AM
Can you point me to an example of working around this limitation?

I.e. how do I configure ObjectDataSource to read my POCO data so that the relationships etc all work as expected?
0
Peter
Top achievements
Rank 1
answered on 20 Feb 2013, 02:06 PM
I eventually got the ObjectDataSource working by pointing it to an entity in my object model and instantiating a context during the Report constructor.

I then stumbled across a video on your website that gave showed me how to bind the report to the source and also showed me the Data Explorer.

I now have a problem that the ICollection references from one POCO to another are not handled in the report.

The reporting solution looks great but I can't find any examples that cover my scenario and the forum is a bit sparse - creating a report shouldn't be this difficult.
0
Stef
Telerik team
answered on 22 Feb 2013, 12:32 PM
Hi Peter,

Please check the attached sample illustrating the usage of nested collections via objectDataSource component.

I hope this helps.

Kind regards,
Stef
the Telerik team

See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

0
Heiko
Top achievements
Rank 1
answered on 06 Mar 2013, 10:22 AM
Hi Stef!

Can you tell us if there are any plans to integrate DbContext and EF 5 in your reporting component? EF 5 was released in August 2012 and is the Framework to use in the future so it should by supported.

Regards
Neils
0
Stef
Telerik team
answered on 11 Mar 2013, 02:28 PM
Hi Neils,

As my colleague has mentioned, having DbContext support is in our future plans and until that moment please use the suggested approaches for working with EF. In addition, please check what Telerik OpenAccess ORM can offer to you: 7 Reasons to Choose OpenAccess ORM over Entity Framework

Let us know if you have any other concerns.

Greetings,
Stef
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

0
Unknown
Top achievements
Rank 1
answered on 29 Jul 2013, 09:56 AM
DbContext is supported now, which is very good news since using ObjectContext generator is not always an option and that eliminates the need for workarounds.
0
Jeff
Top achievements
Rank 1
answered on 01 Aug 2013, 08:18 PM
Is there any documentation or examples that show how to use DBContext ?  That would really be helpful -- Jeff
0
Peter
Telerik team
answered on 05 Aug 2013, 08:38 AM
Hi Jeff,

The EntityDataSource documentation including how to use the DBContext is available with the Telerik Reporting offline documentation available for download from your account Home / Your Products. Additionally we have scheduled update for the online help later this week.

Regards,
Peter
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Steve
Telerik team
Peter
Top achievements
Rank 1
Stef
Telerik team
Heiko
Top achievements
Rank 1
Unknown
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Peter
Telerik team
Share this question
or