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
項目的完整限定網址,包括檔名,以及在 SharePoint 模式下的副檔名。
- Target
- String
商品的新完全限定網址,包括檔名和副檔名。
- 屬性
範例
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 標頭的使用 | (在) TrustedUserHeaderValue (出局) ServerInfoHeaderValue |
| 原生模式所需權限 | 這取決於物品類型: - Folder:UpdateProperties一直Item持續CreateFolderTarget- Report:UpdateProperties一直Item持續CreateReportTarget- Resource:UpdateProperties一直Item持續CreateResourceTarget- DataSource:UpdateProperties一直Item持續CreateDatasourceTarget- Model:UpdateProperties一直Item持續CreateModelTarget |
| SharePoint 模式 必要權限 |
<xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> 在 和 Item<xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>Target 上(如果目標的父資料夾不同) |
如果一個項目繼承了其父項目的安全政策,移動該項目會繼承目標資料夾的安全政策。 如果一個項目沒有繼承其父項目的安全政策,移動該項目不會導致其安全政策改變。
若目標路徑不在與該項目相同的報告伺服器資料庫或 SharePoint 網站中,則rsInvalidDestination會回傳錯誤。
在報表伺服器資料庫或 SharePoint 文件庫 中移動或重新命名項目會ModifiedBy修改該項目的 and ModifiedDate 屬性,以及該項目的來源和目標資料夾。