ReportingService2010.ListChildren(String, Boolean) メソッド

定義

指定されたフォルダの子リストを取得します。

public:
 cli::array <ReportService2010::CatalogItem ^> ^ ListChildren(System::String ^ ItemPath, bool Recursive);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/ListChildren", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
public ReportService2010.CatalogItem[] ListChildren(string ItemPath, bool Recursive);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/ListChildren", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)>]
[<System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)>]
[<System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")>]
member this.ListChildren : string * bool -> ReportService2010.CatalogItem[]
Public Function ListChildren (ItemPath As String, Recursive As Boolean) As CatalogItem()

パラメーター

ItemPath
String

親フォルダのフルパス名。

Recursive
Boolean

指定された項目の下にある子項目の木全体を返すかどうかを示す Boolean 式です。 既定値は false です。

注:このパラメータをSharePointモードでtrueに設定すると、アプリケーションのパフォーマンスが大幅に低下する可能性があります。

返品

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

属性

以下のコード例をコンパイルするには、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 ReportingService2010()  
      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()  
   {  
      ReportingService2010 rs = new ReportingService2010();  
      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);  
      }  
   }  
}  

注釈

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

SOAPヘッダーの使用 (イン) TrustedUserHeaderValue

(アウト) ServerInfoHeaderValue
ネイティブモードの必要権限 ReadPropertiesItem
SharePointモードの必要権限 <xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>

このメソッドは、ユーザーが閲覧権限を持つ子項目のみを返します。 返されるアイテムは、指定された親アイテムの子アイテムの完全なリストを表すとは限りません。

このメソッドがレポートサーバーデータベースのルート上で「My Reports」が有効になっている場合、このメソッドは「My Reports」フォルダのプロパティを含む CatalogItem オブジェクトの配列を返します。 ユーザーが匿名で「マイレポート」が有効の場合、このメソッドがルート上で呼び出された際に「マイレポート」のプロパティは返されません。

このメソッドは、レポートサーバーデータベース内の仮想パスをサポートする項目の VirtualPath プロパティを返すことができます。 仮想パスとは、ユーザーがアイテムを見ることを期待する経路のことです。 例えば、ユーザーの個人の「My Reports」フォルダにある「Report1」というレポートは、仮想パスとして「/My Reports」と等しいです。 アイテムの実際の経路は /Users/Username/My Reports です。

このメソッドが返すプロパティの大半は読み取り専用です。 Reporting Servicesのアイテムプロパティの詳細については、「Report Server Item Properties」をご覧ください。

適用対象