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

Binding to WCF data list

5 Answers 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jordan
Top achievements
Rank 1
Jordan asked on 11 Jul 2013, 02:46 PM
Hi Guys,

I have a C# project with a class with this method:
class Program
 {
        static void Main()
        {
            Service1Client client = new Service1Client();
            var data = client.GetGraphData(5, 150, 10, "Goodbye", "Hello");

            client.Close();
        }
 }

data is two columns with a bunch of numbers. 

Then I have a web application with a webform and a report viewer. I want a report that utilizes that data variable. How would I accomplish this?

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Jul 2013, 12:36 PM
Hi Jordan,

First you have to set up your report definition. For this check out the Report Structure help articles. You have to databind your report definition as elaborate in the Using Telerik Reporting with WCF RIA Services help article. Finally you can set your report definition to the ReportViewer.ReportSource as illustrated in the How to: Add report viewer to a web page help article.

Regards,
Peter
Telerik

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

0
Jordan
Top achievements
Rank 1
answered on 15 Jul 2013, 01:54 PM
So I'm comfortable creating a report and adding it to an aspx page, I'm just unsure how to make the data source of my charts and graphs in the report point to the WCF service.

So in the code I pasted, I want to be able to bind a table or graph to the "data" variable. In the second link you pasted, I'm not sure if the fact I'm not using a Silverlight application will cause an issue - I'm trying to embed the report in an aspx page. 

In that link, when he says "Add a partial class to extend the domain service soap client with a method that returns RootResults that are acceptable for the ObjectDataSource:" I'm not sure what the domain service soap client is.

Thanks.
0
Stef
Telerik team
answered on 18 Jul 2013, 04:28 PM
Hi Jordan,

"domain service soap client" refers to the client serving the AdventureWorksDomainService1 in the linked to the blog post example.

In your case, you have a service reference to consume your service (Service1) in a console application. If you create a report definition in that application and add an ObjectDataSource component, it can use the ServiceReference.ServiceClient as data object, and then its GetGraphData method as data member.

Basically the idea of this data source is to allow the usage of any custom data retrieval you need.

I hope this helps.

Regards,
Stef
Telerik

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

0
Jordan
Top achievements
Rank 1
answered on 18 Jul 2013, 05:55 PM
Great, that worked. I was able to create an object data source with the WCF data. I'm running into a different issue now though. When I go to create a table with the object data source, upon previewing it I get an InnerException error as shown in my attachment. Any ideas? I've copied the endpoint of my output.config into App.config, but it's still throwing this error.

Thanks again.
0
Stef
Telerik team
answered on 23 Jul 2013, 01:45 PM
Hello Jordan,

As stated in the blog article mentioned by my colleague:
"the Report Designer can't get the schema of the data source because of WCF RIA services' peculiarities. Thus be aware that the available wizards and Data Explorer would not be populated with data source fields and both Previews would not work."

This is because the Visual Studio Report Designer operates inside the Visual Studio application. When previewing a report the report constructor is executed in the context of the Visual Studio application. In this case the configuration file is is devenv.exe.config. Thus if you want to have a preview you have to add the service endpoints in the devenv.exe.config (for VS2010 on 32 bit machine it is located in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config. For 64 bit Windows you should look in the C:\Program Files (x86)
\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config
)

Generally to debug your data access layer while you are using the VS designer you have to open another Visual Studio instance, select Debug->Attach to process to debug another instance of devenv.exe and select Debug->Exception... to enable  the First Chance Exceptions

Let us know if you have any further questions.

Regards,
Stef
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
Jordan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Jordan
Top achievements
Rank 1
Stef
Telerik team
Share this question
or