Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ReportingService2005.SetProperties Method

Sets one or more properties of a specified item.

Namespace:  ReportService2005
Assembly:  ReportService2005 (in ReportService2005.dll)
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("BatchHeaderValue")]
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetProperties", RequestNamespace = "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
	ResponseNamespace = "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void SetProperties(
	string Item,
	Property[] Properties
)

Parameters

Item
Type: System.String
The full path name of the item.
Properties
Type: ReportService2005.Property[]
An array of Property objects that defines the properties and values to set for the item.

The table below shows header and permissions information on this operation.

SOAP Headers

(In) BatchHeaderValue

(Out) ServerInfoHeaderValue

Required Permissions

Depends on the item type:

You can create new user-defined properties for an item by passing a Property object as a method argument. To remove a property from an item, set the property to an empty value. You cannot remove reserved properties. For a list of reserved item properties, see Report Server Item Properties.

If a specified property does not exist when the SetProperties method is called, the property is created and set to the value you supply. If the property already exists, its value is overwritten. Setting an empty value for a property that does not exist has no effect on the item or its properties.

If an error occurs, no properties are set.

To compile the following 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 sets a new description for the Company Sales report:

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

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

      Property[] props = new Property[1];
      Property setProp = new Property();
      setProp.Name = "Description";
      setProp.Value = "Sales by quarter and product category.";
      props[0] = setProp;

      string itemPath = "/SampleReports/Company Sales"; 

      try
      {
         rs.SetProperties(itemPath, props);
         Console.WriteLine("New description set on item {0}.", itemPath);
      }

      catch (SoapException ex)
      {
         Console.WriteLine(ex.Detail.OuterXml);
      }
   }
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.