ReportingService2010.CreateLinkedItem 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
新增一個連結項目到報告伺服器資料庫。
public:
void CreateLinkedItem(System::String ^ ItemPath, System::String ^ Parent, System::String ^ Link, cli::array <ReportService2010::Property ^> ^ Properties);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateLinkedItem", 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 CreateLinkedItem(string ItemPath, string Parent, string Link, ReportService2010.Property[] Properties);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateLinkedItem", 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.CreateLinkedItem : string * string * string * ReportService2010.Property[] -> unit
Public Sub CreateLinkedItem (ItemPath As String, Parent As String, Link As String, Properties As Property())
參數
- ItemPath
- String
新連結項目的檔名,包括檔名。
- Parent
- String
新增項目的父資料夾的完全限定網址。
- Link
- String
項目定義所用的完全限定網址。
- 屬性
範例
要編譯此程式碼範例,您必須參考 Reporting Services WSDL 並匯入特定命名空間。 欲了解更多資訊,請參閱編 譯與執行程式碼範例。 以下程式碼範例會建立一個連結報告:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2010()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim prop As New [Property]()
prop.Name = "Description"
prop.Value = "A new linked report"
Dim props(0) As [Property]
props(0) = prop
Try
rs.CreateLinkedItem("Employee Sales Report2", "/SampleReports", "/SampleReports/Employee Sales Summary", props)
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
End Try
End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;
class Sample
{
public static void Main()
{
ReportingService2010 rs = new ReportingService2010();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
Property prop = new Property();
prop.Name = "Description";
prop.Value = "A new linked report";
Property[] props = new Property[1];
props[0] = prop;
try
{
rs.CreateLinkedItem("Employee Sales Report2", "/SampleReports",
"/SampleReports/Employee Sales Summary", props);
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
}
}
備註
下表顯示此操作的標頭與權限資訊。
| SOAP 標頭的使用 | (在) TrustedUserHeaderValue (出局) ServerInfoHeaderValue |
| 原生模式所需權限 |
CreateReport一直持續ParentReadPropertiesItemPath |
| SharePoint 模式 必要權限 | 不支援 |
與參數的長度Parent不得超過 260 個字元;否則會拋出帶有錯誤碼 Link SOAP 例外。
Parent且Link參數不能為空或空,且不包含以下保留字元: : ? ; @ & = + $ , \ * > < | . "。 你可以用斜杠(/)來分隔資料夾完整路徑名稱中的項目,但不能用在資料夾名稱的末尾
連結項目具有與標準目錄項目相同的屬性,但不包含自己的項目定義。 連結項目不能引用另一個連結項目。
連結項目的創建者必須有權限閱讀該連結項目所參考項目的定義;然而,執行連結項目並不需要此層級的權限。
使用該 CreateLinkedItem 方法會改變 ModifiedBy 父資料夾的 and ModifiedDate 屬性。