语言

ReportingService2010.CreateLinkedItem 方法

定义

向报告服务器数据库添加一个新的关联项目。

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。

Properties
Property[]

一个对象数组 Property ,定义了为关联项目设置的属性名称和值。

属性

示例

要编译此代码示例,您必须引用 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一直往ParentReadProperties下ItemPath
SharePoint 模式 必要权限 不支持

和参数的长度Parent不得超过260个字符;否则,会抛出带有错误代码LinkSOAP异常。

Parent和Link参数不能为空或空,也不能包含以下保留字符: : ? ; @ & = + $ , \ * > < | . "。 你可以用斜杠字符(/)分隔文件夹完整路径名称中的项目,但不能用在文件夹名称末尾

关联的项目具有与标准目录项目相同的属性,但它不包含自己的项目定义。 关联的项目不能引用另一个关联的项目。

链接项目的创建者必须有权限阅读该链接项目所引用的定义;不过,运行关联项目不需要这种权限级别。

使用该 CreateLinkedItem 方法会更改 ModifiedBy 父文件夹的 和 ModifiedDate 属性。

适用于