ReportingService2010.MoveItem(String, String) ReportingService2010.MoveItem(String, String) ReportingService2010.MoveItem(String, String) Method

定义

移动和/或重命名某项。 Moves and/or renames an item. 此方法适用于所有项类型。 This method applies to all item types.

public:
 void MoveItem(System::String ^ ItemPath, System::String ^ Target);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/MoveItem", 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 MoveItem (string ItemPath, string Target);
Public Sub MoveItem (ItemPath As String, Target As String)
参数
ItemPath
String String String

项的完全限定 URL,其中包括文件名(在 SharePoint 模式下,还有扩展名)。 The fully qualified URL of the item including the file name and, in SharePoint mode, the extension.

Target
String String String

项的新完全限定 URL,其中包括文件名和扩展名。 The new fully qualified URL of the item including the file name and extension.

示例

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;  

        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 ReportingService2010()  
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer/" + _  
            "ReportService2010.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  

注解

下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.

SOAP 标头使用情况SOAP Header Usage (In) TrustedUserHeaderValue(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
纯模式所需的权限Native Mode Required Permissions 取决于项目类型:Depends on the item type:

- Folder:UpdatePropertiesItemANDCreateFolderTarget- Folder: UpdateProperties on Item AND CreateFolder on Target
- Report:UpdatePropertiesItemANDCreateReportTarget- Report: UpdateProperties on Item AND CreateReport on Target
- Resource:UpdatePropertiesItemANDCreateResourceTarget- Resource: UpdateProperties on Item AND CreateResource on Target
- DataSource:UpdatePropertiesItemANDCreateDatasourceTarget- DataSource: UpdateProperties on Item AND CreateDatasource on Target
- Model:UpdatePropertiesItemANDCreateModelTarget- Model: UpdateProperties on Item AND CreateModel on Target
SharePoint 模式所需的权限SharePoint Mode Required Permissions EditListItemsItemANDAddListItems上中的父文件夹Target(如果不同的目标父文件夹)EditListItems on Item AND AddListItems on the parent folder in Target (if the target parent folder is different)

如果某项从其父级继承安全策略,则移动的项将会导致继承目标文件夹的安全策略。If an item inherits security policies from its parent, moving the item causes it to inherit the security policies of the target folder. 如果某个项不从其父级继承安全策略,因此移动项不会导致若要更改其安全策略。If an item does not inherit security policies from its parent, moving the item does not cause its security policies to change.

如果目标路径不在同一个报表服务器数据库或 SharePoint 站点为给定的项,rsInvalidDestination返回错误。If the target path is not in the same report server database or SharePoint site as the given item, an rsInvalidDestination error is returned.

移动或重命名报表服务器数据库或 SharePoint 库中的项修改ModifiedByModifiedDate的项目和项的源和目标文件夹的属性。Moving or renaming items in a report server database or SharePoint library modifies the ModifiedBy and ModifiedDate properties of the item and the source and target folders of the item.

适用于