Karl Hoaglund
Karl Hoaglund

Reputation: 643

SSRS Render()-- Can't get the simplest of examples to compile

I'm trying to build a Windows desktop app to render reports located in SQL Server Reporting Services. I've been pulling my hair out because none of the examples I've found will compile. Here are the steps I followed:

  1. Opened Visual Studio and created a Windows desktop app using C# (WPF)

  2. Pasted in sample code from here (Microsoft).

  3. Created a service reference to http://localhost/reportserver/ReportExecution2005.asmx, the SSRS Web service that is supposed to provide the needed Render() method. I called it ReportExecution2005.

  4. Added a reference to System.Web.Services.

  5. Added Using statements for the Web service reference and the System.Web.Services.

So, I have these two added references and the Using statements shown below.

enter image description here

My problem is that ReportExecutionService does not exist. I can't find it anywhere. Can you tell me what I'm doing wrong? Thanks so much for your help!

enter image description here

Upvotes: 0

Views: 794

Answers (1)

Jay Nanavaty
Jay Nanavaty

Reputation: 1129

Since you are accessing old ASMX service (classic asp service), you can try using Add Web Reference which you will find under the same dialog which you open via "Add Service Reference" and then click "Advanced" and Choose "Add Web Reference".

Once you do so, you should be able to compile your code without any issues. Make sure you remove existing reference to the service you have added via "Add Service Reference" to avoid any ambiguity in the client proxy code.

Having said this, you can still use "Add Service Reference" but with some modification to your sample code. But as of now the given solution should work for you. To know more about the difference, please have a look here:

Web Reference vs. Service Reference

Upvotes: 3

Related Questions