ReportingService2005.GetReportDefinition Method

レポートの定義を取得します。

名前空間: Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005
アセンブリ: ReportService2005 (reportingservice2005.dll 内)

構文

'宣言
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction:=SoapHeaderDirection.Out)> _
Public Function GetReportDefinition ( _
    Report As String _
) As Byte()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)] 
public byte[] GetReportDefinition (
    string Report
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse::Literal, ParameterStyle=SoapParameterStyle::Wrapped)] 
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction=SoapHeaderDirection::Out)] 
public:
array<unsigned char>^ GetReportDefinition (
    String^ Report
)
/** @attribute SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) */ 
/** @attribute SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) */ 
public byte[] GetReportDefinition (
    String Report
)
SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) 
SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) 
public function GetReportDefinition (
    Report : String
) : byte[]

パラメータ

  • Report
    レポートの完全なパス名です。

戻り値

Base64 エンコードされたバイト配列で表したレポート定義です。このデータ型の詳細については、Microsoft .NET Framework のドキュメントの「Byte 構造体」を参照してください。

使用例

このコード例をコンパイルするには、Reporting Services の WSDL を参照し、特定の名前空間をインポートする必要があります。詳細については、「コード例のコンパイルと実行」を参照してください。次のコード例では、GetReportDefinition メソッドを使用してレポートの定義を取得し、ローカル ファイル システムの XML ドキュメントとして保存します。

Imports System
Imports System.IO
Imports System.Web.Services.Protocols

Class Sample
   Public Shared Sub Main()
      Dim rs As New ReportingService2005
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials

      Dim reportName As String = "/SampleReports/Company Sales"
      Dim reportDefinition As Byte() = Nothing
      Dim doc As New System.Xml.XmlDocument

      Try
         reportDefinition = rs.GetReportDefinition(reportName)
         Dim stream As New MemoryStream(reportDefinition)

         doc.Load(stream)
         doc.Save("C:\Company Sales.rdl")

      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml.ToString())

      Catch e As IOException
         Console.WriteLine(e.Message)
      End Try
   End Sub 'Main
End Class 'Sample
using System;
using System.IO;
using System.Web.Services.Protocols;

class Sample
{
   public static void Main()
   {
      ReportingService2005 rs = new ReportingService2005();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

      string reportName = "/SampleReports/Company Sales";
      byte[] reportDefinition = null;
      System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

      try
      {
         reportDefinition = rs.GetReportDefinition(reportName);
         MemoryStream stream = new MemoryStream(reportDefinition);

         doc.Load(stream);
         doc.Save(@"C:\Company Sales.rdl");
      }

      catch (SoapException e)
      {
         Console.WriteLine(e.Detail.InnerXml.ToString()); 
      }

      catch (IOException e)
      {
         Console.WriteLine(e.Message);
      }
   }
}

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

ReportingService2005 Class
ReportingService2005 Members
Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005 Namespace