言語

ReportingService2005.SetProperties(String, Property[]) メソッド

定義

指定されたアイテムの1つ以上のプロパティを設定します。

public:
 void SetProperties(System::String ^ Item, cli::array <ReportService2005::Property ^> ^ Properties);
public void SetProperties(string Item, ReportService2005.Property[] Properties);
member this.SetProperties : string * ReportService2005.Property[] -> unit
Public Sub SetProperties (Item As String, Properties As Property())

パラメーター

Item
String

アイテムのフルパス名。

Properties
Property[]

Propertyオブジェクトの配列で、そのアイテムに対して設定するプロパティや値を定義します。

以下のコード例をコンパイルするには、Reporting ServicesのWSDLを参照し、特定の名前空間をインポートする必要があります。 詳細については 、「コード例のコンパイルと実行」をご覧ください。 以下のコード例は、会社営業レポートの新しい記述を示しています。

Imports System  
Imports System.Web.Services.Protocols  

Class Sample  
   Public Shared Sub Main()  
      Dim rs As New ReportingService2005()  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials  

      Dim props(0) As [Property]  
      Dim setProp As New [Property]()  
      setProp.Name = "Description"  
      setProp.Value = "Sales by quarter and product category."  
      props(0) = setProp  

      Dim itemPath As String = "/SampleReports/Company Sales"  

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

      Catch ex As SoapException  
         Console.WriteLine(ex.Detail.OuterXml)  
      End Try  
   End Sub 'Main  
End Class 'Sample  
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);  
      }  
   }  
}  

注釈

以下の表は、この操作のヘッダーおよび権限情報を示しています。

SOAPヘッダー (イン) BatchHeaderValue

(アウト) ServerInfoHeaderValue
必要なアクセス許可 アイテムの種類によります:

- Folder: UpdateProperties
- Report: UpdateProperties
- Resource: UpdateProperties
- DataSource: UpdateProperties
- Model: UpdateProperties

Propertyオブジェクトをメソッド引数として渡すことで、新しいユーザー定義プロパティを作成できます。 アイテムからプロパティを削除するには、そのプロパティを空の値に設定します。 予約物件は削除できません。 予約済みアイテムプロパティの一覧については 、「レポートサーバーアイテムプロパティ」をご覧ください。

SetPropertiesメソッドを呼び出した時点で指定されたプロパティが存在しない場合、そのプロパティが作成され、提供した値に設定されます。 もしそのプロパティがすでに存在している場合、その価値は上書きされます。 存在しないプロパティに空値を設定しても、そのアイテムやそのプロパティには影響しません。

エラーが発生した場合は、プロパティは設定されません。

適用対象