ReportingService2005.FindItems(String, BooleanOperatorEnum, SearchCondition[]) Method


从报表服务器数据库中返回与搜索条件匹配的项。Returns items from a report server database that match the search criteria.

 cli::array <ReportService2005::CatalogItem ^> ^ FindItems(System::String ^ Folder, ReportService2005::BooleanOperatorEnum BooleanOperator, cli::array <ReportService2005::SearchCondition ^> ^ Conditions);
public ReportService2005.CatalogItem[] FindItems (string Folder, ReportService2005.BooleanOperatorEnum BooleanOperator, ReportService2005.SearchCondition[] Conditions);
member this.FindItems : string * ReportService2005.BooleanOperatorEnum * ReportService2005.SearchCondition[] -> ReportService2005.CatalogItem[]
Public Function FindItems (Folder As String, BooleanOperator As BooleanOperatorEnum, Conditions As SearchCondition()) As CatalogItem()



要搜索的文件夹的完全限定 URL。The fully qualified URL of the folder to search. 要搜索整个报表服务器数据库,请指定根文件夹 (/)。To search the entire report server database, specify the root folder (/).


逻辑运算符,应用该逻辑运算符可连接搜索条件。The logical operator that is applied to connect the search conditions. 可能值为 ANDORPossible values are AND and OR. 默认值是 ANDThe default value is AND.


一个 SearchCondition 对象的数组,该数组定义要搜索的属性名和属性值。An array of SearchCondition objects that defines the property names and values for which to search.



报表服务器数据库中与指定搜索条件对应的对象的 CatalogItem 数组。An array of CatalogItem objects in the report server database that correspond to the specified search criteria.


若要编译此代码示例,必须引用 Reporting Services WSDL 并导入某些命名空间。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. 下面的代码示例在 Report Server 数据库中搜索名称中包含 "Sales" 一词的所有报告: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  

         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  
      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;  

         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() );   


下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.

SOAP 标头SOAP Headers (Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
所需的权限Required Permissions 如果不是组件搜索: ReadPropertiesIf not a component search: ReadProperties

仅返回具有各自权限的项 ReadPropertiesOnly the items with the respective ReadProperties permission are returned.

参数的长度 Folder 不能超过260个字符; 否则,将引发带有错误代码 RSITEMLENGTHEXCEEDED 的 SOAP 异常。The length of the Folder parameter cannot exceed 260 characters; otherwise, a SOAP exception is thrown with the error code rsItemLengthExceeded.

Folder参数不能为 null 或为空,也不能包含以下保留字符: : ? ; @ & = + $ , \ * > < | . "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.

Report Server 不支持搜索条件中间的通配符。The report server does not support wildcard characters in the middle of the search condition. 通配符包括%、_、[、]、^ 和-。Wildcard characters include %, _, [, ], ^, and -. 如果存在通配符,则 Report Server 按原义处理字符。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.

的搜索功能 FindItems 不区分大小写。The search functionality of FindItems is case-insensitive.

使用的应用程序 FindItems 通常会接受用户输入的特定属性和属性值。Applications that use FindItems typically accept user input for specific properties and property values. 可搜索的属性包括 Name 、、 Description CreatedByCreationDateModifiedByModifiedDateThe searchable properties are Name, Description, CreatedBy, CreationDate, ModifiedBy, and ModifiedDate. 返回的项仅是用户对其具有权限的那些项 Read PropertiesThe items that are returned are only those for which a user has Read Properties permission.

Applies to