【问题标题】:SQL Reporting Services DataConnection UpdateSQL Reporting Services 数据连接更新
【发布时间】:2010-09-17 02:52:00
【问题描述】:

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

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

编辑:客户端正在运行安装了所有服务包的 SQL Server 2000 Reporting Services。

【问题讨论】:

  • 这通常可以通过 Web 服务接口连接到 RS。哪个版本的 Reporting Services?
  • 这是 SQL Server 2000 报告服务。非常感谢任何帮助!

标签: sql-server reporting-services connection-string datasource publish


【解决方案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 服务对话而生成的 Proxy 类,[此处](http://msdn.microsoft.com/en-us/library/aa256607(SQL.80).aspx).

我希望这会有所帮助。如果您正在寻找不同的东西,请告诉我。

【讨论】:

  • SetReportDataSources 在 RS 2005 中被重命名为 SetItemDataSources
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多