积极答复者
引用报表的WEB服务代理类出现问题

问题
-
你好:
我在学习Report Service的<教程:使用 Visual Basic 或 Visual C# 访问报表服务器 Web 服务>http://technet.microsoft.com/zh-cn/library/ms169926%28v=sql.100%29,但是在学习第三页<访问 Web 服务>http://technet.microsoft.com/zh-cn/library/ms170088%28v=sql.100%29时候出现问题,要我创建一个 Web 服务代理类的实例 ReportingService2005,这个该如何创建?是不是这样呢
using System; using System.Collections.Generic; using System.Linq; using System.Text; using GetPropertiesSample.ReportService2005; using System.Web.Services.Protocols; using System.Web.Services; namespace GetPropertiesSample { [WebServiceBindingAttribute(Name = "ReportingService2005Soap", Namespace = "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices")] public class ReportingService2005 : SoapHttpClientProtocol { } class Program { static void Main(string[] args) { ReportingService2005 rs = new ReportingService2005(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials; rs.Url = "http://ReportService2008/reportserver/reportservice2005.asmx"; Property name = new Property(); name.Name = "Name"; Property description = new Property(); description.Name = "Description"; Property[] properties = new Property[2]; properties[0] = name; properties[1] = description; try { Property[] returnProperties = rs.GetProperties("/AdventureWorks 2008 Sample Reports/Company Sales 2008", properties); foreach (Property p in returnProperties) { Console.WriteLine(p.Name + ": " + p.Value); } } catch (Exception e) { Console.WriteLine(e.Message); } } } }
但是如果是这样的话,rs.GetProperties("/AdventureWorks 2008 Sample Reports/Company Sales 2008", properties);
这句话报错,“GetPropertiesSample.ReportingService2005”不包含“GetProperties”的定义,并且找不到可接受类型为“GetPropertiesSample.ReportingService2005”的第一个参数的扩展方法“GetProperties”(是否缺少 using 指令或程序集引用?) ,我不知道该如何处理,请高手解答一下,我用的是vs2010和sqlserver2008 r2的,谢谢
- 已编辑 张懿 2012年7月6日 4:16
答案
-
你好,
请问是否安装了示例报表Company Sale? 请确定"/AdventureWorks 2008 Sample Reports/Company Sales 2008" 。 是否有效。
thanks.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
- 已标记为答案 Molly Chen_Moderator 2012年7月13日 7:55
全部回复
-
你好,
请问是否安装了示例报表Company Sale? 请确定"/AdventureWorks 2008 Sample Reports/Company Sales 2008" 。 是否有效。
thanks.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
- 已标记为答案 Molly Chen_Moderator 2012年7月13日 7:55