ReportingService2005.GetProperties(String, Property[]) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回报告服务器数据库中某个项目的一个或多个属性的值。
public:
cli::array <ReportService2005::Property ^> ^ GetProperties(System::String ^ Item, cli::array <ReportService2005::Property ^> ^ Properties);
public ReportService2005.Property[] GetProperties(string Item, ReportService2005.Property[] Properties);
member this.GetProperties : string * ReportService2005.Property[] -> ReportService2005.Property[]
Public Function GetProperties (Item As String, Properties As Property()) As Property()
参数
- Item
- String
完整的路径名称或物品的ID。
返回
一组 Property 对象,表示指定物品的属性。
示例
要编译此代码示例,您必须引用 Reporting Services WSDL 并导入某些命名空间。 更多信息请参见编 译与运行代码示例。 以下代码示例使用该 GetProperties 方法检索与公司销售报告相关的描述:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
' Create the property to retrieve.
Dim retrieveProp As New [Property]()
retrieveProp.Name = "Description"
Dim props(0) As [Property]
props(0) = retrieveProp
Try
Dim properties As [Property]() = rs.GetProperties("/SampleReports/Company Sales", props)
Dim prop As [Property]
For Each prop In properties
' Writes the description to the console.
Console.WriteLine(prop.Value)
Next prop
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;
// Create the property to retrieve.
Property retrieveProp = new Property();
retrieveProp.Name = "Description";
Property[] props = new Property[1];
props[0] = retrieveProp;
try
{
Property[] properties = rs.GetProperties("/SampleReports/Company Sales", props);
foreach (Property prop in properties)
{
// Writes the description to the console.
Console.WriteLine(prop.Value);
}
}
catch ( SoapException e )
{
Console.WriteLine( e.Detail.InnerXml.ToString() );
}
}
}
注解
下表显示了该操作的头部和权限信息。
| SOAP 头部 | (在) ItemNamespaceHeaderValue (出局) ServerInfoHeaderValue |
| 所需的权限 | 这取决于物品类型: - Folder: ReadProperties- Report: ReadProperties- Resource: ReadProperties- DataSource: ReadProperties- Model: ReadProperties |
该参数的默认值是完整的路径名称。 要提供ID,必须设置 ItemNamespaceHeader SOAP头。 欲了解更多信息,请参见 GetProperties 方法的设置项目命名空间。
使用该 GetProperties 方法检索完整的用户定义和保留属性集合。 要检索保留属性的标准子集,请使用以下 ListChildren 方法。 关于报告服务器数据库中保留项目的属性列表,请参见 报告服务器项目属性。
如果Properties参数为null(Nothing在 Visual Basic 中),则返回指定项目的所有属性。 这些包括所有用户自定义和内置的属性,这些属性与该项目相关。
你可以传递参数 Item 的完整路径名,或者传递该项目的ID。 有关使用 SOAP 头实现这一点的更多信息,请参见 Using Reporting Services SOAP 头。