Namespace for ReportingService Class

前端 未结 2 520
滥情空心
滥情空心 2021-01-19 23:29

I can\'t seem to find a clear answer as to how to import the proper namespace for ReportingService http://msdn.microsoft.com/en-us/library/aa258073(v=SQL.80).aspx.

I

相关标签:
2条回答
  • 2021-01-20 00:00

    you have a full example on how to do this from a Console Application in MSDN, here: ReportExecutionService.Render Method which also requires you to read this one: http://msdn.microsoft.com/en-us/library/ms160695.aspx

    in general if you create a .NET 4 Console App you can right click on References in Solution Explorer and select Add Service Reference, it works also with Web Services, not only for WCF.

    For a Report Server running SSRS 2005 or 2008 the web service to reference has this form:

    http://myserver/reportserver/ReportExecution2005.asmx

    scroll the pages I linked above to find the console application example starting like this...

    static void Main(string[] args)
    {
      ReportExecutionService rs = new ReportExecutionService();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
      rs.Url = "http://myserver/reportserver/ReportExecution2005.asmx";
      ...
      ...
    
    0 讨论(0)
  • 2021-01-20 00:00

    Just right click on your project item and select "Add Service Reference"

    enter image description here

    As an alternative solution you can generate the code with the wsdl.exe tool, it is generally what I do for SSRS.

    For example from the VS command prompt:

    wsdl /language:CS /n:"Microsoft.SqlServer.ReportingServices2010" http://<Server Name>/reportserver/reportservice2010.asmx?wsdl
    

    More details on how to create the Web Service Proxy for SSRS.

    0 讨论(0)
提交回复
热议问题