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
要加入新項目之父資料夾的完整 URL。
- Link
- String
要用於項目定義之項目的完整 URL。
- 屬性
範例
若要編譯這個程式碼範例,您必須參考 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 標頭使用方式 | (In) TrustedUserHeaderValue (Out) ServerInfoHeaderValue |
| 原生模式所需的許可權 | CreateReport 開啟 Parent 和 ReadProperties 開啟 ItemPath |
| SharePoint 模式的必要許可權 | 不支援 |
和參數的長度 Parent Link 不能超過260個字元; 否則會擲回 SOAP 例外狀況,並傳回錯誤碼 rsItemLengthExceeded。
Parent和 Link 參數不可以是 null 或空白,或包含下列保留字元: : ? ; @ & = + $ , \ * > < | . " 。 您可以使用正斜線字元 (/) 將資料夾的完整路徑名稱中的專案分開,但不能在資料夾名稱的結尾使用它。
連結的專案與標準目錄專案具有相同的屬性,但是它不包含它自己的專案定義。 連結的專案無法參考另一個連結的專案。
連結專案的建立者必須有權讀取連結專案所參考之專案的定義;不過,執行連結的專案不需要此層級的許可權。
使用 CreateLinkedItem 方法會變更 ModifiedBy 上層資料夾的和 ModifiedDate 屬性。