Udostępnij przez


Metoda ReportingService2010.ListChildren

Pobiera listę elementów podrzędnych określonego folderu.

Przestrzeń nazw:  ReportService2010
Zestaw:  ReportService2010 (w ReportService2010.dll)

Składnia

'Deklaracja
<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()
'Użycie
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[]

Parametry

  • ItemPath
    Typ: System.String
    Pełną nazwę ścieżka folderu nadrzędnego.
  • Recursive
    Typ: System.Boolean
    A wartość logiczna wyrażenie, która wskazuje, czy zwrócić całe drzewo podrzędność elementy poniżej określonego element.Wartością domyślną jest false.
    Uwaga Ustawienie tego parametru na true w programie SharePoint tryb mogą znacznie zmniejszyć wydajność aplikacji.

Wartość zwracana

Typ: array<ReportService2010.CatalogItem[]
Tablica CatalogItem obiektów.Jeśli dzieci nie istnieje, Metoda ta zwraca pustą tablicę.

Uwagi

W poniższej tabela przedstawiono informacje nagłówka i uprawnienia na tej operacji.

Użycie nagłówek protokołu SOAP

(W)TrustedUserHeaderValue

(Ruch wychodzący)ServerInfoHeaderValue

Tryb macierzysty wymagane uprawnienia

ReadProperties na Item

Tryb programu SharePoint wymagane uprawnienia

ViewListItems()

Metoda zwraca tylko elementy podrzędność, które użytkownik ma uprawnienia do wyświetlania.Elementy, które są zwracane nie może reprezentować pełną listę elementów podrzędność element nadrzędnego określonego.

Jeśli metoda ta jest wywoływana w katalogu głównym baza danych serwera raportów z włączonym Moje raporty, metoda zwraca tablicę CatalogItem obiektów zawierających właściwości folderu Raporty.Jeśli użytkownik jest anonimowy Moje raporty jest włączony, właściwości Moje raporty nie są zwracane, gdy metoda ta jest wywoływana w katalogu głównym.

Ta metoda może zwracać VirtualPath właściwość elementów w baza danych serwera raportów , obsługuje ścieżki wirtualnej.Ścieżka wirtualna jest ścieżką, pod którym użytkownik spodziewa się element.Na przykład raport o nazwie "report1" folder znajduje się w osobistym Moje raporty użytkownika ma ścieżka wirtualnej równą "raportów /My".Rzeczywiste ścieżka element jest /Users/Username/Moje raporty.

Większość właściwości metoda zwraca tylko do odczytu.Aby uzyskać więcej informacji na temat właściwości element w usługach Reporting Services, zobacz Właściwości elementu raportu serwera.

Przykłady

Aby skompilować poniższy przykład kodu, musi odniesienie WSDL usług raportowania i przywozu niektórych obszarów nazw.Aby uzyskać więcej informacji, zobacz temat Compiling and Running Code Examples.Następujący kod w przykładzie wykorzystano ListChildren metoda odczytać zawartość katalogu głównego serwer raportów drzewa katalogów, a następnie zapisuje pierwszy element i jego właściwości jako dokument 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);
      }
   }
}