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

Using EF6 and EntityDataSource in report designer

1 Answer 171 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Noah
Top achievements
Rank 1
Noah asked on 10 Jul 2015, 06:47 PM

I have tried several times to create a new Telerik Report with with Visual Studio Report Designer. I am able to create reports that connect to a database using the SqlDataSource, however when I try and connect using the EntityDataSource, I end up with the report preview throwing one of two errors related to connection string and/or dbconnection.

 

1)I created a class library in a separate project complete with an EF6 edmx and dbcontext class. All went well.

2) I added an reference to the project in my Report library project. All went well

3) I created a new report with the designer and added an EntityDataSource using the wizard. It recognized my entity model gave me options for choosing the entity in the model I wanted to use.

4) I tried to flip to the Preview and Html Preview and get an error indicating "no connection string named "myentitiesname" could be found in the application config file.

5) I even tried adding the connection string to the project's app.config file with no luck. 

 

From the reading online, it seems like I may need to manually configure the connection string /db context for the preview to work, but I am not sure exactly what is needed.

 

 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 13 Jul 2015, 10:06 AM
Hello Noah,

When using DbContext by default the generated context class (Database First or Model First) provides only a default (parameterless) constructor. However for design time purposes a constructor with connection string (string argument) is needed so that while processing the report the correct connection string can be passed.
For more information on implementing the second constructor, please refer to the EntityDataSource Component help article.

In case there is still an issue with the Designer Preview/HTML Preview, we advise using a report viewer (e.g. WinForms Viewer) to preview the report.

Regards,
Nasko
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
General Discussions
Asked by
Noah
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or