ReportingService2006.SetProperties Method

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

名前空間: ReportService2006
アセンブリ: ReportService2006 (reportservice2006.dll 内)

構文

'宣言
Public Sub SetProperties ( _
    Item As String, _
    Properties As Property() _
)
public void SetProperties (
    string Item,
    Property[] Properties
)
public:
void SetProperties (
    String^ Item, 
    array<Property^>^ Properties
)
public void SetProperties (
    String Item, 
    Property[] Properties
)
public function SetProperties (
    Item : String, 
    Properties : Property[]
)

パラメータ

  • Item
    ファイル名と拡張子を含む、アイテムの完全修飾 URL です。
  • Properties
    アイテムに設定するプロパティと値を定義する Property オブジェクトの配列です。

解説

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

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

エラーが発生すると、プロパティは設定されません。

Item="/" のときに rsOperationNotSupportedSharePointMode エラーを返します。

使用例

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)
    {
        ReportingService2006 rs = new ReportingService2006();
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer/" +
            "ReportService2006.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 ReportingService2006()
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer/" + _
            "ReportService2006.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

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Server 2008, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional with Service Pack 2 (SP2), Windows 2000 Professional, Windows 2000 Advanced Server, Windows XP Home Edition, サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。, Windows Vista, Windows Mobile 5.0, Windows Mobile 2003 for Pocket PC, Windows CE 5.0

参照

関連項目

ReportingService2006 Class
ReportingService2006 Members
ReportService2006 Namespace