FindItems 方法
从报表服务器数据库中返回与搜索条件匹配的项。
命名空间: ReportService2005
程序集: ReportService2005(在 ReportService2005.dll 中)
语法
声明
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/FindItems", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", _
ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function FindItems ( _
Folder As String, _
BooleanOperator As BooleanOperatorEnum, _
Conditions As SearchCondition() _
) As CatalogItem()
用法
Dim instance As ReportingService2005
Dim Folder As String
Dim BooleanOperator As BooleanOperatorEnum
Dim Conditions As SearchCondition()
Dim returnValue As CatalogItem()
returnValue = instance.FindItems(Folder, _
BooleanOperator, Conditions)
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/FindItems", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public CatalogItem[] FindItems(
string Folder,
BooleanOperatorEnum BooleanOperator,
SearchCondition[] Conditions
)
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/FindItems", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
array<CatalogItem^>^ FindItems(
String^ Folder,
BooleanOperatorEnum BooleanOperator,
array<SearchCondition^>^ Conditions
)
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/FindItems", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member FindItems :
Folder:string *
BooleanOperator:BooleanOperatorEnum *
Conditions:SearchCondition[] -> CatalogItem[]
public function FindItems(
Folder : String,
BooleanOperator : BooleanOperatorEnum,
Conditions : SearchCondition[]
) : CatalogItem[]
参数
- Folder
类型:System. . :: . .String
要搜索的文件夹的完全限定 URL。要搜索整个报表服务器数据库,请指定根文件夹 (/)。
- BooleanOperator
类型:ReportService2005. . :: . .BooleanOperatorEnum
逻辑运算符,应用该逻辑运算符可连接搜索条件。可能值为 AND 和 OR。默认值为 AND。
- Conditions
类型:array<ReportService2005. . :: . .SearchCondition> [] () [] []
SearchCondition 对象的数组,它定义要搜索的属性名和属性值。
返回值
类型:array<ReportService2005. . :: . .CatalogItem> [] () [] []
报表服务器数据库中与指定搜索条件对应的对象的 CatalogItem 数组。
注释
The table below shows header and permissions information on this operation.
SOAP Headers |
(Out) ServerInfoHeaderValue |
Required Permissions |
If not a component search: ReadProperties Only the items with the respective ReadProperties permission are returned. |
The length of the Folder parameter cannot exceed 260 characters; otherwise, a SOAP exception is thrown with the error code rsItemLengthExceeded.
The Folder parameter cannot be null or empty or contain the following reserved characters: : ? ; @ & = + $ , \ * > < | . ". You can use the forward slash character (/) to separate items in the full path name of the folder, but you cannot use it at the end of the folder name.
The report server does not support wildcard characters in the middle of the search condition. Wildcard characters include %, _, [, ], ^, and -. If a wildcard character is present, the report server treats the character literally.
Only one instance of a property name can be supplied in the set of search conditions.
The search functionality of FindItems is case-insensitive.
Applications that use FindItems typically accept user input for specific properties and property values. The searchable properties are Name, Description, CreatedBy, CreationDate, ModifiedBy, and ModifiedDate. The items that are returned are only those for which a user has Read Properties permission.
示例
To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples. The following code example searches the report server database for all reports whose names contain the word "Sales":
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 items As CatalogItem() = Nothing
Dim condition As New SearchCondition()
condition.Condition = ConditionEnum.Contains
condition.ConditionSpecified = True
condition.Name = "Name"
condition.Value = "Sales"
Dim conditions(0) As SearchCondition
conditions(0) = condition
Try
items = rs.FindItems("/", BooleanOperatorEnum.Or, conditions)
If Not (items Is Nothing) Then
Dim ci As CatalogItem
For Each ci In items
Console.WriteLine("Item {0} found at {1}", ci.Name, ci.Path)
Next ci
End If
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;
CatalogItem[] items = null;
SearchCondition condition = new SearchCondition();
condition.Condition = ConditionEnum.Contains;
condition.ConditionSpecified = true;
condition.Name = "Name";
condition.Value = "Sales";
SearchCondition[] conditions = new SearchCondition[1];
conditions[0] = condition;
try
{
items = rs.FindItems( "/", BooleanOperatorEnum.Or, conditions );
if ( items != null )
{
foreach ( CatalogItem ci in items)
{
Console.WriteLine( "Item {0} found at {1}", ci.Name, ci.Path );
}
}
}
catch ( SoapException e )
{
Console.WriteLine( e.Detail.InnerXml.ToString() );
}
}
}