ReportingService2005.ListChildren(String, Boolean) 메서드

정의

지정된 폴더의 자식 목록을 가져옵니다.

public:
 cli::array <ReportService2005::CatalogItem ^> ^ ListChildren(System::String ^ Item, bool Recursive);
public ReportService2005.CatalogItem[] ListChildren (string Item, bool Recursive);
member this.ListChildren : string * bool -> ReportService2005.CatalogItem[]
Public Function ListChildren (Item As String, Recursive As Boolean) As CatalogItem()

매개 변수

Item
String

부모 폴더의 전체 경로 이름입니다.

Recursive
Boolean

자식 항목의 전체 트리를 지정된 항목 아래에 반환할지 여부를 나타내는 Boolean 식입니다. 기본값은 false입니다.

반환

CatalogItem 개체의 배열입니다. 자식이 없으면 이 메서드는 비어 있는 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 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);  
      }  
   }  
}  

설명

다음 표에서는 이 작업에 대한 헤더 및 사용 권한 정보를 보여 줍니다.

SOAP 헤더 (Out) ServerInfoHeaderValue
필요한 권한 Item가 있는 경우 ReadProperties

메서드는 ListChildren 사용자가 볼 수 있는 권한이 있는 자식 항목만 반환합니다. 반환되는 항목은 지정된 부모 항목의 자식 항목의 전체 목록을 나타내지 않을 수 있습니다.

ListChildren 내 보고서를 사용하도록 설정된 보고서 서버 데이터베이스의 루트에서 메서드가 호출되면 메서드는 내 보고서 폴더에 대한 속성을 포함하는 개체의 CatalogItem 배열을 반환합니다. 사용자가 익명이고 내 보고서가 사용하도록 설정된 경우 루트에서 가 호출될 때 ListChildren 내 보고서의 속성이 반환되지 않습니다.

메서드는 ListChildren 가상 경로를 지원하는 보고서 서버 데이터베이스에 있는 항목의 속성을 반환 VirtualPath 할 수 있습니다. 가상 경로는 사용자가 항목을 볼 것으로 예상되는 경로입니다. 예를 들어 사용자의 개인 내 보고서 폴더에 있는 "Report1"이라는 보고서에는 "/My Reports"와 같은 가상 경로가 있습니다. 항목의 실제 경로는 /Users/Username/My Reports입니다.

이 메서드가 반환하는 대부분의 속성은 읽기 전용입니다. Reporting Services 항목 속성에 대한 자세한 내용은 보고서 서버 항목 속성을 참조하세요.

적용 대상