ReportingService2006.MoveItem Method (String, String)

 

Moves and/or renames an item.

Namespace:   ReportService2006
Assembly:  ReportService2006 (in ReportService2006.dll)

public void MoveItem(
	string Item,
	string Target
)

Parameters

Item
Type: System.String

The fully qualified URL of the item including the file name and extension.

Target
Type: System.String

The new fully qualified URL of the item including the file name and extension.

The table below shows header and permissions information on this operation.

SOAP Headers

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Required Permissions

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.

If the target path is not in the same SharePoint site as the given item, an rsInvalidDestination error is returned.

Moving or renaming items in a SharePoint library modifies the ModifiedBy and ModifiedDate properties of the item and the source and target folders of the item.

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);
        }
    }
}
Return to top
Show: