CrystalReportViewer.SearchForText Method

Searches the report for the given text.

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

Syntax

'Declaration
Public Overrideable Function SearchForText ( _
    ByVal text As String _  
) As Boolean
public virtual bool SearchForText (
    string text
)

Parameters

  • text
    Represents the string to search for.

Return Value

Returns true if the text was found, or false if the text was not found.

Remarks

If the text is found, then the CrystalReportViewer control will move to the position of the text.

Example

The below method will search the report for the specified String parameter.

'Declaration

    Private Function SearchForText(ByVal myText As String) As Boolean
      SearchForText = CrystalReportViewer.SearchForText(myText)
    End Function
    private bool SearchForText(String text)
    {
      return crystalReportViewer.SearchForText(text);
    }

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