質問

公開されたSQLレポートサービスレポートの接続文字列を変更することはできますか? ReportServerデータベースにDataSourceというバイナリフィールドがありますが、バイナリとして格納されているため、簡単に更新できるとは思いません。

正しいデータソースでレポートを再発行する必要がありますか? VS2003をインストールする必要がないので、私は望んでいません。

編集:クライアントは、すべてのサービスパックがインストールされたSQL Server 2000 Reporting Servicesを実行しています。

役に立ちましたか?

解決

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 クラスは、[ここ]( http://msdn.microsoft.com/en-us/library/aa256607(SQL.80) .aspx)

これがいくらか役立つことを願っています。何か違うものを探しているなら教えてください。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top