次の方法で共有


ReportingService2006.MoveItem(String, String) メソッド

定義

アイテムの移動や名前の変更を行います。

public:
 void MoveItem(System::String ^ Item, System::String ^ Target);
public void MoveItem (string Item, string Target);
member this.MoveItem : string * string -> unit
Public Sub MoveItem (Item As String, Target As String)

パラメーター

Item
String

ファイル名と拡張子を含む、アイテムの完全修飾 URL です。

Target
String

ファイル名と拡張子を含む、アイテムの新しい完全修飾 URL です。

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;  

        string currentPath = "http://<Server Name>/Docs/Documents" +  
            "/Data Sources/Sales Order Detail.rdl";  
        string targetPath = "http://<Server Name>/Docs/Documents/" +  
            "AdventureWorks Sample Reports/Sales Order Detail.rdl";  

        try  
        {  
            rs.MoveItem(currentPath, targetPath);  
        }  

        catch (SoapException e)  
        {  
            Console.WriteLine(e.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 currentPath As String = "http://<Server Name>/Docs/" + _  
            "Documents/AdventureWorks Sample Reports/Sales Order Detail.rdl"  
        Dim targetPath As String = "http://<Server Name>/Docs/" + _  
            "Documents/Data Sources/Sales Order Detail.rdl"  

        Try  
            rs.MoveItem(currentPath, targetPath)  

        Catch e As SoapException  
            Console.WriteLine(e.Detail.OuterXml)  
        End Try  

    End Sub  

End Class  

注釈

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

SOAP ヘッダー (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
必要なアクセス許可 Item に対する <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>、および Target の親フォルダーに対する <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> (ターゲットの親フォルダーが異なる場合)

アイテムが親からセキュリティ ポリシーを継承する場合は、アイテムを移動すると、ターゲット フォルダーのセキュリティ ポリシーが継承されます。 アイテムが親からセキュリティ ポリシーを継承しない場合は、アイテムを移動してもセキュリティ ポリシーは変更されません。

ターゲット パスが指定したアイテムと同じ SharePoint サイトではない場合、rsInvalidDestination エラーが返されます。

SharePoint ライブラリ内のアイテムの移動または名前の変更を行うと、アイテムとそのアイテムの移動 (変更) 元と移動 (変更) 先フォルダーの ModifiedBy プロパティと ModifiedDate プロパティが変更されます。

適用対象