Export (0) Print
Expand All
Expand Minimize

GetProperties Method

SQL Server 2000

ReportingService.GetProperties Method

Returns the value of one or more properties of an item in the report server database.

Public Function GetProperties( _
   ByVal Item As String, _
   ByVal Properties() As [Namespace].Property _
) As String
   Member of [Namespace].ReportingService

public string GetProperties(
   string Item,
   [Namespace].Property[] Properties
);
   Member of [Namespace].ReportingService
Parameters
Item
The full path name of the item or the ID of the item. The default value that must be passed for this argument is the full path name of the item. To supply an ID, you must set the ItemNamespaceHeader SOAP header. For more information, see Setting the Item Namespace for the GetProperties Method.
Properties
An array of Property[] objects that contains the properties for which you want to retrieve values.
Return Value

An array of Property[] objects that represents the properties of the specified item.

Permissions

Operation Description
Read Properties Required to read the meta data properties that are associated with an item.

Remarks

Use the GetProperties method to retrieve the complete set of user-defined and reserved properties. To retrieve the standard subset of reserved properties, use the ListChildren method. For a list of the reserved properties of items in the report server database, see Report Server Item Properties.

If the Properties parameter is null (Nothing in Visual Basic), all properties for the specified item are returned. These include all user-defined and built-in properties that are specific to the item.

You can pass the full path name of the item for the Item parameter or you can supply the ID of the item. For more information about using SOAP headers to accomplish this, see Using Reporting Services SOAP Headers.

Example

To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples. The following code example uses the GetProperties method to retrieve the description associated with the Company Sales report:

Imports System
Imports System.Web.Services.Protocols

Class Sample
   Public Shared Sub Main()
      Dim rs As New ReportingService()
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials
      
      ' Create the property to retrieve.
      Dim retrieveProp As New [Property]()
      retrieveProp.Name = "Description"
      Dim props(0) As [Property]
      props(0) = retrieveProp
      
      Try
         Dim properties As [Property]() = rs.GetProperties("/SampleReports/Company Sales", props)
         
         Dim prop As [Property]
         For Each prop In  properties
            ' Writes the description to the console.
            Console.WriteLine(prop.Value)
         Next prop
      
      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml.ToString())
      End Try
   End Sub 'Main
End Class 'Sample

using System;
using System.Web.Services.Protocols;

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

      // Create the property to retrieve.
      Property retrieveProp = new Property();
      retrieveProp.Name = "Description";
      Property[] props = new Property[1];
      props[0] = retrieveProp;

      try
      {
         Property[] properties = rs.GetProperties("/SampleReports/Company Sales", props);

         foreach (Property prop in properties)
         {
            // Writes the description to the console.
            Console.WriteLine(prop.Value);
         }
      }

      catch ( SoapException e )
      {
         Console.WriteLine( e.Detail.InnerXml.ToString() );
      }
   }
}
See Also

ReportingService Class

Reporting Services Web Service Library

Show:
© 2014 Microsoft