2

是否可以更改已发布的sql报告服务报告的连接字符串?我可以在ReportServer数据库中看到名为DataSource的二进制字段,但由于它是以二进制形式存储的,我不认为它很容易更新。SQL Reporting Services DataConnection更新

我是否需要使用正确的数据源重新发布报告?我希望不是因为我不想安装VS2003。

编辑:客户端运行SQL Server 2000报告服务与所有服务包安装。

+0

这通常可以通过RS的Web服务接口来实现。 Reporting Services的哪个版本? – 2008-10-15 22:21:30

+0

这是SQL Server 2000报告服务。任何帮助是极大的赞赏! – 2008-10-16 12:59:45

回答

1

SQL Reporting Services 2000有一个[Web服务](http://msdn.microsoft.com/en-us/library/aa274396(SQL.80).aspx)),您可以使用它来更改数据源。因此,以下内容允许将数据源更改为共享数据源。 MSDN](http://msdn.microsoft.com/en-us/library/aa225896(SQL.80).aspx)

// Create our reporting services class 
ReportingService theRS = new ReportingService(); 
theRS.Credentials = System.Net.CredentialCache.DefaultCredentials; 

// We need to setup a data source reference to an existing shared data source 
DataSourceReference theDSRef = new DataSourceReference(); 
theDSRef.Reference = "/Path/To/ExistingSharedDataSource"; 
DataSource[] theDSArray = new DataSource[1]; 
DataSource theDS = new DataSource(); 
theDS.Item = (DataSourceReference)theDSRef; 
theDS.Name = "NameOfSharedDataSource"; 
theDSArray[0] = theDS; 

try 
{ 
    // Attempt to change the data source of the report 
    theRS.SetReportDataSources("/Path/To/ReportName", theDSArray); 
    Console.Out.WriteLine("We have changed the data source"); 
} 
catch (System.Web.Services.Protocols.SoapException e) 
{ 
    Console.Out.WriteLine(e.Message); 
    Console.Out.WriteLine(e.Detail.InnerXml.ToString()); 
} 

在这个例子中,ReportingService类是从我生成交谈的web服务,其被描述在[此处](http://msdn.microsoft.com/en-us/library/aa256607(SQL.80).aspx)

Proxy类取我希望这能帮助一些人。让我知道我如果你正在寻找不同的东西。