Поделиться через


Метод MoveItem

Перемещает или переименовывает элемент. Этот метод подходит для всех типов элементов.

Пространство имен:  ReportService2010
Сборка:  ReportService2010 (в ReportService2010.dll)

Синтаксис

'Декларация
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/MoveItem", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub MoveItem ( _
    ItemPath As String, _
    Target As String _
)
'Применение
Dim instance As ReportingService2010
Dim ItemPath As String
Dim Target As String

instance.MoveItem(ItemPath, Target)
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/MoveItem", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void MoveItem(
    string ItemPath,
    string Target
)
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/MoveItem", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
void MoveItem(
    String^ ItemPath, 
    String^ Target
)
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/MoveItem", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member MoveItem : 
        ItemPath:string * 
        Target:string -> unit 
public function MoveItem(
    ItemPath : String, 
    Target : String
)

Параметры

  • ItemPath
    Тип: System. . :: . .String
    Полный URL-адрес элемента, включая имя файла, а также (в режиме интеграции с SharePoint) расширение.
  • Target
    Тип: System. . :: . .String
    Новый полный URL-адрес элемента, включая имя файла и расширение.

Замечания

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

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

Depends on the item type:

SharePoint Mode 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 report server database or SharePoint site as the given item, an rsInvalidDestination error is returned.

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.

Примеры

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