Expand Minimize
This topic has not yet been rated - Rate this topic

MoveItem Method

SQL Server 2000

ReportingService.MoveItem Method

Moves or renames an item.

Public Sub MoveItem( _
   ByVal Item As String _
   ByVal Target As String _
)
   Member of [Namespace].ReportingService
public void MoveItem(
   string Item,
   string Target
);
   Member of [Namespace].ReportingService
Parameters
Item
The full path name of the item.
Target
The new full path name of the item.
Permissions

Operation Description
Create Folder Required for creating a subfolder within a folder.
Update Properties Required for adding or modifying properties on folders, reports, and resources.
Create Report Required on target folders.
Create Resource Required on target folders.

Remarks

The permissions required to perform this operation depend on the item type.

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.

When My Reports is enabled, you cannot move the /My Reports or /Users folders. An attempt to do so produces a SOAP exception with the error code rsInvalidMove.

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.

Example

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. 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 ReportingService()
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials
      
      Dim currentPath As String = "/SampleReports/Employee Sales Summary"
      Dim targetPath As String = "/Employee Sales Summary"
      
      Try
         rs.MoveItem(currentPath, targetPath)
      
      Catch e As SoapException
         Console.WriteLine(e.Detail.OuterXml)
      End Try
   End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;

class Sample
{
   public static void Main()
   {
      ReportingService rs = new ReportingService();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
      
      string currentPath = "/SampleReports/Employee Sales Summary";
      string targetPath = "/Employee Sales Summary";

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

      catch (SoapException e)
      {
         Console.WriteLine(e.Detail.OuterXml);
      }
   }
}
See Also

ReportingService Class

Reporting Services Web Service Library

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.