Share via


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

定義

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

public:
 void SetProperties(System::String ^ ItemPath, cli::array <ReportService2010::Property ^> ^ Properties);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
[System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
public void SetProperties (string ItemPath, ReportService2010.Property[] Properties);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)>]
[<System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")>]
[<System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)>]
member this.SetProperties : string * ReportService2010.Property[] -> unit
Public Sub SetProperties (ItemPath As String, Properties As Property())

パラメーター

ItemPath
String

ファイル名と拡張子 (SharePoint モードの場合) を含む、アイテムの完全修飾 URL です。

Properties
Property[]

アイテムに設定するプロパティと値を定義する Property オブジェクトの配列です。

属性

using System;  
using System.Collections.Generic;  
using System.IO;  
using System.Text;  
using System.Web;  
using System.Web.Services;  
using System.Web.Services.Protocols;  

class Sample  
{  
    static void Main(string[] args)  
    {  
        ReportingService2010 rs = new ReportingService2010();  
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer/" +  
            "ReportService2010.asmx";  
        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 = "http://<Server Name>/Docs/Documents/" +  
            "AdventureWorks Sample Reports/Sales Order Detail.rdl";  

        try  
        {  
            rs.SetProperties(itemPath, props);  
            Console.WriteLine("New description set on item {0}.",   
                itemPath);  
        }  
        catch (SoapException ex)  
        {  
            Console.WriteLine(ex.Detail.OuterXml);  
        }  
    }  
}  
Imports System  
Imports System.IO  
Imports System.Text  
Imports System.Web.Services  
Imports System.Web.Services.Protocols  

Class Sample  

    Public Shared Sub Main()  

        Dim rs As New ReportingService2010()  
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer/" + _  
            "ReportService2010.asmx"  
        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 = "http://<Server Name>/Docs/" + _  
            "Documents/AdventureWorks Sample Reports/" + _  
            "Sales Order Detail.rdl"  

        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  

End Class  

注釈

次の表に、この操作に関連するヘッダーおよび権限の情報を示します。

SOAP ヘッダーの使用方法 (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
ネイティブ モードで必要なアクセス許可 アイテムの種類によって異なります。

- Folder: UpdateProperties
- Report: UpdateProperties
- Resource: UpdateProperties
- DataSource: UpdateProperties
- Model: UpdateProperties
SharePoint モードで必要なアクセス許可 <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>

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

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

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

Item="/" のときは rsOperationNotSupportedSharePointMode エラーが返されます。

適用対象