Skip to content

PreviewFind - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

Boolean

Arguments

Argument Description
sText The text to search for
bDown Search direction; true for downwards, false for upwards
bWholeWord True to ignore occurrences of sText where it is part of a word, false when occurrences within larger words are also desired.
bMatchCase True for case-sensitive search, false otherwise.

Description

Attempts to find the text in sText using the bDown value for the find direction, the bWholeWord for focus on whole words only, and bMatchCase for case-sensitive finds. If the text is found, the page will show, and the text is indicated by a red colored rectangle.

This method cannot be used before the report OCX object is initialized. The COM object creation is, when not done before, created as part of the OpenReport method.

DataFlex Framework usage

  • Windows
  • Windows controls in a FlexTron application

Sample

Object oReport is a cDRReport
    Set psReportName to 'MyReport.dr'
End_Object

Object oRunReportButton is a Button
    Set Label to 'Run Report'

    Procedure OnClick
        Send RunReport of oReport
    End_Procedure
End_Object

Object oTextForm is a Form
    Set Label to "Search:"
    Set Location to 5 50
End_Object

Object oDownCheckbox is a Checkbox
    Set Location to 20 50
    Set Label to "Down"
End_Object

Object oWholeWordCheckbox is a Checkbox
    Set Location to 35 50
    Set Label to "Whole Word"
End_Object

Object oMatchCaseCheckbox is a Checkbox
    Set Location to 40 50
    Set Label to "Match Case"
End_Object

Object oFindButton is a Button
    Set Label to 'Find'

    Procedure OnClick
        String sText
        Boolean bDown bWholeWord bMatchCase bFound

        Get Value Of oTextForm to sText
        Get Checked_State of oDownCheckbox to bDown
        Get Checked_State of oWholeWordCheckbox to bWholeWord
        Get Checked_State of oMatchCaseCheckbox to bMatchCase

        Get PreviewFind of oReport sText bDown bWholeWord bMatchCase to bFound
        If (bFound) Begin
            Send PreviewPaint of oReport
        End
    End_Procedure
End_Object