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


Returns items from a report server database that match the search criteria.

Namespace:   ReportService2005
Assembly:  ReportService2005 (in ReportService2005.dll)

public CatalogItem[] FindItems(
	string Folder,
	BooleanOperatorEnum BooleanOperator,
	SearchCondition[] Conditions


Type: System.String

The fully qualified URL of the folder to search. To search the entire report server database, specify the root folder (/).

Type: ReportService2005.BooleanOperatorEnum

The logical operator that is applied to connect the search conditions. Possible values are AND and OR. The default value is AND.

Type: ReportService2005.SearchCondition[]

An array of SearchCondition objects that defines the property names and values for which to search.

Return Value

Type: ReportService2005.CatalogItem[]

An array of CatalogItem objects in the report server database that correspond to the specified search criteria.

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":

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() ); 
Return to top