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

Reporting on Entity Framework context

3 Answers 75 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 06 Jun 2016, 11:05 AM

Hi,

I have hooked up an extender to my entity framework model and the dll I use has a public DbContext object. In the Data Explorer of the report designer I see all my entity objects/tables just fine but I don't see any of the columns ie. I can only drag the entire table onto my report and then in preview I just get a series of sql statements as below, but I cannot drag individual columns and I cannot see the actual data in my report:

Select [Extent1].[ID] as [ID],

Select [Extent1].[Name] as [Name],..... etc.

 

What am I doing wrong here?

3 Answers, 1 is accepted

Sort by
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 06 Jun 2016, 11:07 AM
Also, I should mention that I am using an Object DataSource (not an Entity datasource) because I want to switch the db connection at runtime.
0
Accepted
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 06 Jun 2016, 12:13 PM

I'm not sure why I saw the results I did above but I think it stems from the fact that DbContext shouldn't be used as a datasource directly. Using the code below in my extender dll the data was returned just fine:

        public List<MyDBContext.MyTable> ReportData()
        {
            return MyDBContext.MyTable.ToList();
        }

0
Stef
Telerik team
answered on 07 Jun 2016, 02:34 PM
Hello Alwin,

Thank you for this update.

I am uncertain about the source of the initial issue. Please check if the previously used data-retrieval method returned an object exposing properly its properties. The known reasons fields will not be available for work in the designer are listed here - Data Explorer does not show all or any data fields.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Stef
Telerik team
Share this question
or