次の方法で共有


ReportingService2010.ListChildren メソッド

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

名前空間:  ReportService2010
アセンブリ:  ReportService2010 (ReportService2010.dll)

構文

'宣言
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/ListChildren", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ListChildren ( _
    ItemPath As String, _
    Recursive As Boolean _
) As CatalogItem()
'使用
Dim instance As ReportingService2010 
Dim ItemPath As String 
Dim Recursive As Boolean 
Dim returnValue As CatalogItem()

returnValue = instance.ListChildren(ItemPath, _
    Recursive)
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/ListChildren", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public CatalogItem[] ListChildren(
    string ItemPath,
    bool Recursive
)
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/ListChildren", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
array<CatalogItem^>^ ListChildren(
    String^ ItemPath, 
    bool Recursive
)
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/ListChildren", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member ListChildren : 
        ItemPath:string * 
        Recursive:bool -> CatalogItem[] 
public function ListChildren(
    ItemPath : String, 
    Recursive : boolean
) : CatalogItem[]

パラメーター

  • ItemPath
    型: System.String
    親フォルダーの完全なパス名です。
  • Recursive
    型: System.Boolean
    指定したアイテムの下の子アイテムのツリー全体を返すかどうかを示す Boolean 式です。 既定値は false です。 メモ: SharePoint モードでこのパラメーターを true に設定すると、アプリケーションのパフォーマンスが大幅に低下する可能性があります。

戻り値

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

説明

次の表に、この操作に関連するヘッダーおよび権限の情報を示します。

SOAP ヘッダーの使用方法

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

ネイティブ モードで必要な権限

ReadProperties : 対象はItem

SharePoint モードで必要な権限

ViewListItems

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

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

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

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

使用例

次のコード例をコンパイルするには、Reporting Services の WSDL を参照し、特定の名前空間をインポートする必要があります。 詳細については、「Compiling and Running Code Examples」を参照してください。 次のコード例では、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);
      }
   }
}

関連項目

参照

ReportingService2010 クラス

ReportService2010 名前空間