Reporting on Entity Framework context

4 posts, 1 answers
  1. Al
    Al avatar
    203 posts
    Member since:
    Oct 2006

    Posted 06 Jun Link to this post

    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?

  2. Al
    Al avatar
    203 posts
    Member since:
    Oct 2006

    Posted 06 Jun in reply to Al Link to this post

    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.
  3. DevCraft banner
  4. Answer
    Al
    Al avatar
    203 posts
    Member since:
    Oct 2006

    Posted 06 Jun Link to this post

    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();
            }

  5. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 07 Jun Link to this post

    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
Back to Top