Skip to content

psFilterFunction - cDRReport

Methods - Properties - Events

Type

String

Default

None

Arguments

Argument Description
sReportID ID of the report. Can be ID of the main report or the ID of a sub-report. This argument can be passed as an empty string. The empty string can be written as C_USEMAINDRREPORTID.

Description

Sets/Gets the filter function of a report.

Although the contents of the filter function are executed for each record, dependent on the result (true or false), the record will or will not be used for the report. An attempt is made to perform a jump into and out of index with the returned value. For such an operation do not use a complex function with, for example, an IF statement.

This property 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

  • Web
  • Windows
  • FlexTron

Sample

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

    Procedure OnInitializeReport
        String sReportId

        Forward Send OnInitializeReport

        Get psReportId to sReportId
        Set psFilterFunction sReportId to 'return ({Titles.YearPublished} = 1984)'
    End_Procedure
End_Object

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

    Procedure OnClick
        String sReportId sFilterFunction

        Send RunReport of oReport

        Get psReportId of oReport to sReportId
        Get psFilterFunction of oReport sReportId to sFilterFunction
    End_Procedure
End_Object