ReportingService2005.ListChildren Method

指定したフォルダの子の一覧を取得します。

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

構文

'宣言
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren", 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 ListChildren ( _
    Item As String, _
    Recursive As Boolean _
) As CatalogItem()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren", 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 CatalogItem[] ListChildren (
    string Item,
    bool Recursive
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren", 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<CatalogItem^>^ ListChildren (
    String^ Item, 
    bool Recursive
)
/** @attribute SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren", 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 CatalogItem[] ListChildren (
    String Item, 
    boolean Recursive
)
SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren", 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 ListChildren (
    Item : String, 
    Recursive : boolean
) : CatalogItem[]

パラメータ

  • Item
    親フォルダの完全なパス名です。
  • Recursive
    指定したアイテムの下の子アイテムのツリー全体を返すかどうかを示す Boolean 式です。既定値は false です。

戻り値

CatalogItem オブジェクトの配列です。子が存在しない場合、このメソッドは空の CatalogItem オブジェクトを返します。

解説

ListChildren メソッドは、ユーザーが表示する権限を持っている子アイテムのみを返します。そのため、返されるアイテムは、指定した親アイテムの子アイテムの完全な一覧であるとは限りません。

個人用レポートが有効で、レポート サーバー データベースのルートで ListChildren メソッドが呼び出された場合、このメソッドは、個人用レポート フォルダのプロパティを表す CatalogItem オブジェクトの配列を返します。ユーザーが匿名で、個人用レポートが有効な場合、ルートで ListChildren が呼び出されても、個人用レポートのプロパティは返されません。

ListChildren メソッドは、仮想パスをサポートするレポート サーバー データベース内のアイテムの VirtualPath プロパティを返すことができます。仮想パスは、ユーザーがその下にあるアイテムを表示するパスです。たとえば、ユーザー個人の "個人用レポート" フォルダにある Report1 という名前のレポートの仮想パスは、"/個人用レポート" となります。アイテムの実際のパスは、"/Users/Username/個人用レポート" です。

このメソッドが返すプロパティの大部分は読み取り専用です。Reporting Services のアイテムのプロパティの詳細については、「レポート サーバー アイテムのプロパティ」を参照してください。

使用例

次のコード例をコンパイルするには、Reporting Services の WSDL を参照し、特定の名前空間をインポートする必要があります。詳細については、「コード例のコンパイルと実行」を参照してください。次のコード例では、ListChildren メソッドを使用して、レポート サーバー ディレクトリ ツリーのルートの内容を読み取り、最初のアイテムとそのプロパティを XML ドキュメントとして保存します。

Imports System
Imports System.IO
Imports System.Text
Imports System.Web.Services.Protocols
Imports System.Xml
Imports System.Xml.Serialization

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

      Dim items As CatalogItem() = Nothing

      ' Retrieve a list of all items from the report server database. 
      Try
         items = rs.ListChildren("/", True)

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

      ' Serialize the contents as an XML document and write the contents to a file.
      Try
         Dim fs As New FileStream("CatalogItems.xml", FileMode.Create)
         Dim writer As New XmlTextWriter(fs, Encoding.Unicode)

         Dim serializer As New XmlSerializer(GetType(CatalogItem()))
         serializer.Serialize(writer, items)

         Console.WriteLine("Server contents successfully written to a file.")

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

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

      CatalogItem[] items = null;

      // Retrieve a list of all items from the report server database. 
      try
      {
         items = rs.ListChildren("/", true);
      }

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

      // Serialize the contents as an XML document and write the contents to a file.
      try
      {
         FileStream fs = new FileStream("CatalogItems.xml", FileMode.Create);
         XmlTextWriter writer = new XmlTextWriter(fs, Encoding.Unicode); 

         XmlSerializer serializer = new XmlSerializer(typeof(CatalogItem[]));
         serializer.Serialize(writer, items);

         Console.WriteLine("Server contents successfully written to a file.");
      }

      catch (Exception 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