Language

ReportingService2005.GetReportParameters メソッド

定義

指定されたレポートのパラメータプロパティを報告します。 GetReportParameters(String, String, Boolean, ParameterValue[], DataSourceCredentials[])メソッドは、指定されたレポートのパラメータに対してパラメータ値を検証するためにも使用できます。

public:
 cli::array <ReportService2005::ReportParameter ^> ^ GetReportParameters(System::String ^ Report, System::String ^ HistoryID, bool ForRendering, cli::array <ReportService2005::ParameterValue ^> ^ Values, cli::array <ReportService2005::DataSourceCredentials ^> ^ Credentials);
public ReportService2005.ReportParameter[] GetReportParameters(string Report, string HistoryID, bool ForRendering, ReportService2005.ParameterValue[] Values, ReportService2005.DataSourceCredentials[] Credentials);
member this.GetReportParameters : string * string * bool * ReportService2005.ParameterValue[] * ReportService2005.DataSourceCredentials[] -> ReportService2005.ReportParameter[]
Public Function GetReportParameters (Report As String, HistoryID As String, ForRendering As Boolean, Values As ParameterValue(), Credentials As DataSourceCredentials()) As ReportParameter()

パラメーター

Report
String

報告書の経路名。

HistoryID
String

レポート履歴のIDスナップショット。 レポート履歴スナップショットのパラメータプロパティを取得するために、 ForRendering パラメータを true に設定します。 レポート履歴スナップショットでないレポートのパラメータを取得する場合は、値をnull(Visual BasicではNothing)に設定してください。

ForRendering
Boolean

パラメータ値の使い方を示す Boolean 式です。 trueの値に設定された場合、返されるパラメータプロパティはレポート実行時に使用されたパラメータデータに基づいています。

Values
ParameterValue[]

レポートサーバーが管理するレポートのパラメータに対して検証可能なパラメータ値(ParameterValue オブジェクト)。

Credentials
DataSourceCredentials[]

クエリパラメータの検証に使用できるデータソースの認証情報(DataSourceCredentials オブジェクト)。

返品

レポートのパラメータを一覧にする ReportParameter オブジェクトの配列です。

このコード例をコンパイルするには、Reporting Services WSDLを参照し、特定の名前空間をインポートする必要があります。 詳細については 、「コード例のコンパイルと実行」をご覧ください。 以下のコード例では、 GetReportParameters メソッドを用いてレポートのパラメータメタデータのリストを取得し、各パラメータの名前を表示します。

Imports System  
Imports System.Web.Services.Protocols  

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

      Dim report As String = "/SampleReports/Employee Sales Summary"  
      Dim forRendering As Boolean = False  
      Dim historyID As String = Nothing  
      Dim values As ParameterValue() = Nothing  
      Dim credentials As DataSourceCredentials() = Nothing  
      Dim parameters As ReportParameter() = Nothing  

      Try  
         parameters = rs.GetReportParameters(report, historyID, forRendering, values, credentials)  

         If Not (parameters Is Nothing) Then  
            Dim rp As ReportParameter  
            For Each rp In parameters  
               Console.WriteLine("Name: {0}", rp.Name)  
            Next rp  
         End If  

      Catch e As SoapException  
         Console.WriteLine(e.Detail.InnerXml.ToString())  
      End Try  
   End Sub 'Main  
End Class 'Sample  
using System;  
using System.Web.Services.Protocols;  

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

      string report = "/SampleReports/Employee Sales Summary";  
      bool forRendering = false;  
      string historyID = null;  
      ParameterValue[] values = null;  
      DataSourceCredentials[] credentials = null;  
      ReportParameter[] parameters = null;  

      try  
      {  
         parameters = rs.GetReportParameters(report, historyID, forRendering, values, credentials);  

         if (parameters != null)  
         {  
            foreach (ReportParameter rp in parameters)  
            {  
               Console.WriteLine("Name: {0}", rp.Name);  
            }  
         }  
      }  

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

注釈

以下の表は、この操作のヘッダーおよび権限情報を示しています。

SOAPヘッダー (アウト) ServerInfoHeaderValue
必要なアクセス許可 ReadProperties

レポートの実行設定が Snapshotの場合、返されるパラメータメタデータはレポート履歴スナップショット作成時に使用されたデータです。 レポートの実行設定が Liveされている場合、返されるパラメータメタデータは指定されたレポートに関連付けられたパラメータデータを表します。

HistoryIDパラメータの値を指定し、ForRenderingパラメータの値をtrueに設定すると、返されるパラメータメタデータはレポート履歴スナップショット作成時に使用されたパラメータデータを表します。 HistoryIDに提供された値はForRenderingfalseに設定されている場合は無視されます。ForRenderingfalseされている場合、返されるパラメータメタデータは指定されたレポートに現在関連付けられているパラメータデータを表します。

クエリに基づくパラメータ値がいて、クエリベースのパラメータの有効値リストを返したい場合、 ForRenderingtrueに設定してください。 さらに、クエリベースのパラメータでは、クエリパラメータを返すために必要なすべての認証情報を入力する必要があります。

パラメータ検証に GetReportParameters 法を使用する場合、 Values パラメータが必要です。

与えられたレポートのパラメータが存在しない場合は、空の ReportParameter 配列が返されます。

適用対象