ReportingService2010.MoveItem(String, String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
移动和/或重命名某项。 此方法适用于所有项类型。
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);
[<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)>]
member this.MoveItem : string * string -> unit
Public Sub MoveItem (ItemPath As String, Target As String)
参数
- ItemPath
- String
项的完全限定 URL,其中包括文件名(在 SharePoint 模式下,还有扩展名)。
- Target
- String
项的新完全限定 URL,其中包括文件名和扩展名。
- 属性
示例
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
注解
下表显示了有关此操作的标头和权限信息。
SOAP 标头用法 | (In) TrustedUserHeaderValue (Out) ServerInfoHeaderValue |
本机模式所需的权限 | 取决于项类型: - Folder : UpdateProperties on Item AND CreateFolder on Target - Report : UpdateProperties on Item AND CreateReport on Target - Resource : UpdateProperties on Item AND CreateResource on Target - DataSource : UpdateProperties on Item AND CreateDatasource on Target - Model : UpdateProperties on Item AND CreateModel on Target |
SharePoint 模式所需权限 | <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>如果Item 目标父文件夹不同,则 (中Target 父文件夹上的 AND <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>) |
如果某个项从其父项继承安全策略,则移动该项会导致它继承目标文件夹的安全策略。 如果项未从其父项继承安全策略,则移动该项不会导致其安全策略发生更改。
如果目标路径与给定项不在同一报表服务器数据库或 SharePoint 站点中,则返回错误 rsInvalidDestination
。
移动或重命名报表服务器数据库或 SharePoint 库中的项会 ModifiedBy 修改项的 和 ModifiedDate 属性以及项的源文件夹和目标文件夹。