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 on Parent AND ReadProperties on ItemPath |
SharePoint 模式所需权限 | 不支持 |
和 参数的Parent
长度不能超过 260 个字符;否则,将引发 SOAP 异常,错误代码为 rsItemLengthExceeded。Link
Parent
和 Link
参数不能为 null 或空,也不能包含以下保留字符:: ? ; @ & = + $ , \ * > < | . "
。 可以使用 /) (正斜杠字符分隔文件夹的完整路径名称中的项目,但不能在文件夹名称的末尾使用它
链接项具有与标准目录项相同的属性,但它不包含自己的项定义。 链接项不能引用另一个链接项。
链接项的创建者必须有权读取链接项引用的项的定义;但是,运行链接项不需要此权限级别。
CreateLinkedItem使用 方法更改ModifiedBy父文件夹的 和 ModifiedDate 属性。