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

Silverlight, RIA and Telerik reporting: exception in designer

1 Answer 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 31 Oct 2011, 08:32 PM
My main goal is to set up Telerik reporting in my Silverlight application with RIA Services. But I can't get it working. Even not the easy bits.
I have been reading and trying and reading and trying without any luck.

What did I do:
- Server side (the same project that contains my services and Entity Model): create a "Reports" directory, create a Telerik report in it
- In my Services directory, create a "ReportingService.svc" that contains one line of code: 

<%@ ServiceHost Service="Telerik.Reporting.Service.ReportService, Telerik.Reporting.Service, Version=5.1.11.928, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE" %>

I also updated my web.config file with the proper WCF settings for the ReportService (bindings and endpoints) as explained in the Telerik article.

On my report I set the DataSource to an objectSource with
DataMember = GetBuildings    // this is the name of the method from my DomainService that returns Buildings
DataSource =  ProjectName.Web.Services.BuildingService // full qualified name of my DomainService

My DomainService (BuildingService)
public class BuildingService : LinqToEntitiesDomainService<BuildingEntities>

Where BuildingEntities is my EntityModel.

When in the report designer, I can see the fields of my Building entity. But in the preview windows I receive the error "Exception has been thrown by the target of an invocation. The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider or not valid."

What am I doing wrong?

I must say that I also tried to create a class library with an new entity model to the database (even using the AdventureWorks db), using the EntityDataSource, and I receive the same errors.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 03 Nov 2011, 04:49 PM
Hello Jim,

The problem with the connection string when ObjectDataSource is used occurs, because at design time the ConfigurationManager class cannot find the correct app.config / web.config file of your application. For this reason we simply ditch ConfigurationManager in the designer and use a complex logic instead, that involves a lot of COM interoperability with Visual Studio to resolve the correct configuration settings by hand On the bright side this problem simply does not exist at runtime when everything should work as expected.

However in your case our suggestion is to utilize the EntityDataSource component, that enables data items to connect to an ADO.NET Entity Data Model. This allows seamless integration of Telerik Reporting with ADO.NET Entity Framework. One of the benefits of utilizing the EntityDataSource is dedicated design-time support. The EntityDataSource component has its own set of design-time editors, tool windows, and a configuration wizard. In addition, EntityDataSource adds support for entity schema in Data Explorer and live data preview of the report in Report Designer.

Currently when EntityDataSource component is used the EF Model should be located in a separate class library in order for the report designer and the report wizards to work properly. Additionally you will have to copy the connection string to the web.config/app.config file of the report class library, so that Entity Framework can find your database at design-time. This limitation is caused by Visual Studio Type.GetType and we have to further investigate the issue and undertake appropriate actions.

We highly recommend the Using Telerik Reporting with WCF RIA Services blog article that elaborated on the topic.

Regards,
Peter
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

Tags
General Discussions
Asked by
Jim
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or