Share via


CrystalReportViewer.Search Event

Event fires when text is searched for in the report.

Namespace CrystalDecisions.Windows.Forms Assembly CrystalDecisions.Windows.Forms (CrystalDecisions.Windows.Forms.dll)

Syntax

'Declaration

Public Event Search As CrystalDecisions.Windows.Forms.SearchEventHandler
public event CrystalDecisions.Windows.Forms.SearchEventHandler Search

Event Data

The event handler receives an argument of type SearchEventArgs containing data related to this event. The following SearchEventArgs properties provide information specific to this event.

Property Description
Direction Gets or sets the direction in which to search.
Handled Gets or sets whether the event was handled. Set to true if you do not want the default action to occur.
PageNumberToBeginSearch Gets or sets the page number to start searching at.
TextToSearch Gets or sets the text to search for in the report.

Remarks

This event will be raised when text is searched for in the report.

Example

This example demonstrates how to set a label to display the text that has been searched.

'Declaration

      Private Sub CrystalReportViewer1_Search(ByVal source As Object, _
      ByVal e As CrystalDecisions.Windows.Forms.SearchEventArgs) Handles _
      CrystalReportViewer1.Search
         Label1.Text = e.TextToSearch
      End Sub 
      
      void crystalReportViewer1_Search (Object* sender, CrystalDecisions::Windows::Forms::SearchEventArgs * e)
      {
         Label1->Text = e->TextToSearch;
      };
      
      private void crystalReportViewer1_Search_1(object source, CrystalDecisions.Windows.Forms.SearchEventArgs e)
      {
         Label1.Text = e.TextToSearch;
      }
      

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

CrystalReportViewer Class
CrystalReportViewer Members
CrystalDecisions.Windows.Forms Namespace