ReportingService2005.MoveItem(String, String) Method


移动或重命名某一项。Moves or renames an item.

 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)



项的完整路径名称。The full path name of the item.


项的新完整路径名。The new full path name of the item.


若要编译下面的代码示例,必须引用 Reporting Services WSDL 并导入某些命名空间。To compile the following code example, you must reference the Reporting Services WSDL and import certain namespaces. 有关详细信息,请参阅 编译和运行代码示例For more information, see Compiling and Running Code Examples. 下面的示例代码将 "Employee Sales Summary" 报表从 "Samples" 文件夹移动到根文件夹。The following example code moves the Employee Sales Summary report from the Samples folder to the root folder.

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 currentPath As String = "/SampleReports/Employee Sales Summary"  
      Dim targetPath As String = "/Employee Sales Summary"  

         rs.MoveItem(currentPath, targetPath)  

      Catch e As SoapException  
      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;  

      string currentPath = "/SampleReports/Employee Sales Summary";  
      string targetPath = "/Employee Sales Summary";  

         rs.MoveItem(currentPath, targetPath);  

      catch (SoapException e)  


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

SOAP 标头SOAP Headers (In) BatchHeaderValue(In) BatchHeaderValue

(Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
所需的权限Required Permissions 取决于项类型:Depends on the item type:

- FolderUpdateProperties 打开 ItemCreateFolder 打开 Target- Folder: UpdateProperties on Item AND CreateFolder on Target
- ReportUpdateProperties 打开 ItemCreateReport 打开 Target- Report: UpdateProperties on Item AND CreateReport on Target
- ResourceUpdateProperties 打开 ItemCreateResource 打开 Target- Resource: UpdateProperties on Item AND CreateResource on Target
- DataSourceUpdateProperties 打开 ItemCreateDatasource 打开 Target- DataSource: UpdateProperties on Item AND CreateDatasource on Target
- ModelUpdateProperties 打开 ItemCreateModel 打开 Target- Model: UpdateProperties on Item AND CreateModel on Target

如果项继承其父项的安全策略,则移动该项将导致其继承目标文件夹的安全策略。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.

启用我的报表后,将无法移动/My 报表或/Users 文件夹。When My Reports is enabled, you cannot move the /My Reports or /Users folders. 尝试这样做会产生带有错误代码的 SOAP 异常 rsInvalidMoveAn attempt to do so produces a SOAP exception with the error code rsInvalidMove.

移动或重命名 Report Server 数据库中的项将修改项的 ModifiedByModifiedDate 属性以及该项的源文件夹和目标文件夹。Moving or renaming items in the report server database modifies the ModifiedBy and ModifiedDate properties of the item and the source and target folders of the item.

Applies to