Share via


ReportingService2005.CreateLinkedReport 方法

定义

将新的链接报表添加到报表服务器数据库。

public:
 void CreateLinkedReport(System::String ^ Report, System::String ^ Parent, System::String ^ Link, cli::array <ReportService2005::Property ^> ^ Properties);
public void CreateLinkedReport (string Report, string Parent, string Link, ReportService2005.Property[] Properties);
member this.CreateLinkedReport : string * string * string * ReportService2005.Property[] -> unit
Public Sub CreateLinkedReport (Report As String, Parent As String, Link As String, Properties As Property())

参数

Report
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 ReportingService2005()  
      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.CreateLinkedReport("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()  
   {  
      ReportingService2005 rs = new ReportingService2005();  
      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.CreateLinkedReport("Employee Sales Report2", "/SampleReports",  
            "/SampleReports/Employee Sales Summary", props);  
      }  

      catch (SoapException e)  
      {  
         Console.WriteLine(e.Detail.InnerXml.ToString());   
      }  
   }  
}  

注解

下表显示了有关此操作的标头和权限信息。

SOAP 标头 (In) BatchHeaderValue

(Out) ServerInfoHeaderValue
所需的权限 CreateReport on Parent AND ReadProperties on Report

和 参数的Parent长度不能超过 260 个字符;否则,将引发 SOAP 异常,错误代码为 rsItemLengthExceededLink

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

链接报表具有与标准报表相同的属性,但它不包含自己的报表定义。 链接报表不能引用另一个链接报表。

链接报表的创建者必须有权读取链接报表引用的报表的定义;但是,运行链接报表不需要此级别的权限。

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

适用于