ReportingService2005.MoveItem(String, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
移動或重新命名物品。
public:
void MoveItem(System::String ^ Item, System::String ^ Target);
public void MoveItem(string Item, string Target);
member this.MoveItem : string * string -> unit
Public Sub MoveItem (Item As String, Target As String)
參數
- Item
- String
物品的完整路徑名稱。
- Target
- String
物品的新完整路徑名稱。
範例
要編譯以下程式碼範例,您必須參考 Reporting Services WSDL 並匯入特定命名空間。 欲了解更多資訊,請參閱編 譯與執行程式碼範例。 以下範例程式碼將員工銷售摘要報告從 Samples 資料夾移至 root 資料夾。
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
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()
{
ReportingService2005 rs = new ReportingService2005();
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);
}
}
}
備註
下表顯示此操作的標頭與權限資訊。
| SOAP 標頭 | (在) BatchHeaderValue (出局) ServerInfoHeaderValue |
| 必要權限 | 這取決於物品類型: - Folder:UpdateProperties一直Item持續CreateFolderTarget- Report:UpdateProperties一直Item持續CreateReportTarget- Resource:UpdateProperties一直Item持續CreateResourceTarget- DataSource:UpdateProperties一直Item持續CreateDatasourceTarget- Model:UpdateProperties一直Item持續CreateModelTarget |
如果一個項目繼承了其父項目的安全政策,移動該項目會繼承目標資料夾的安全政策。 如果一個項目沒有繼承其父項目的安全政策,移動該項目不會導致其安全政策改變。
啟用「我的報告」時,你無法移動 /My Reports 或 /Users 資料夾。 嘗試執行此錯誤會產生帶有錯誤代碼 rsInvalidMove的 SOAP 例外。
在報告伺服器資料庫中移動或重新命名項目會 ModifiedBy 修改該項目的 and ModifiedDate 屬性,以及該項目的來源和目標資料夾。